Made it possible to disable the rendering subsystem with configure --disable-render
--- a/configure.in Mon Feb 07 22:57:33 2011 -0800
+++ b/configure.in Tue Feb 08 10:04:09 2011 -0800
@@ -362,6 +362,12 @@
if test x$enable_video != xyes; then
AC_DEFINE(SDL_VIDEO_DISABLED)
fi
+AC_ARG_ENABLE(render,
+AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
+ , enable_render=yes)
+if test x$enable_render != xyes; then
+ AC_DEFINE(SDL_RENDER_DISABLED)
+fi
AC_ARG_ENABLE(events,
AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
, enable_events=yes)
--- a/include/SDL_config.h.in Mon Feb 07 22:57:33 2011 -0800
+++ b/include/SDL_config.h.in Tue Feb 08 10:04:09 2011 -0800
@@ -179,6 +179,7 @@
#undef SDL_JOYSTICK_DISABLED
#undef SDL_HAPTIC_DISABLED
#undef SDL_LOADSO_DISABLED
+#undef SDL_RENDER_DISABLED
#undef SDL_THREADS_DISABLED
#undef SDL_TIMERS_DISABLED
#undef SDL_VIDEO_DISABLED
--- a/src/render/SDL_render.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/SDL_render.c Tue Feb 08 10:04:09 2011 -0800
@@ -45,6 +45,7 @@
static const SDL_RenderDriver *render_drivers[] = {
+#if !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_D3D
&D3D_RenderDriver,
#endif
@@ -61,6 +62,7 @@
&DirectFB_RenderDriver,
#endif
&SW_RenderDriver
+#endif /* !SDL_RENDER_DISABLED */
};
static char renderer_magic;
static char texture_magic;
@@ -170,7 +172,12 @@
SDL_Renderer *
SDL_CreateSoftwareRenderer(SDL_Surface * surface)
{
+#if !SDL_RENDER_DISABLED
return SW_CreateRendererForSurface(surface);
+#else
+ SDL_SetError("SDL not built with rendering support");
+ return NULL;
+#endif /* !SDL_RENDER_DISABLED */
}
int
--- a/src/render/SDL_sysrender.h Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/SDL_sysrender.h Tue Feb 08 10:04:09 2011 -0800
@@ -119,6 +119,8 @@
SDL_RendererInfo info;
};
+#if !SDL_RENDER_DISABLED
+
#if SDL_VIDEO_RENDER_D3D
extern SDL_RenderDriver D3D_RenderDriver;
#endif
@@ -136,6 +138,8 @@
#endif
extern SDL_RenderDriver SW_RenderDriver;
+#endif /* !SDL_RENDER_DISABLED */
+
#endif /* _SDL_sysrender_h */
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/direct3d/SDL_render_d3d.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/direct3d/SDL_render_d3d.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,7 +21,8 @@
*/
#include "SDL_config.h"
-#if SDL_VIDEO_RENDER_D3D
+#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
+
#include "../../core/windows/SDL_windows.h"
@@ -1066,6 +1067,6 @@
SDL_free(renderer);
}
-#endif /* SDL_VIDEO_RENDER_D3D */
+#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/opengl/SDL_render_gl.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/opengl/SDL_render_gl.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,7 +21,7 @@
*/
#include "SDL_config.h"
-#if SDL_VIDEO_RENDER_OGL
+#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
#include "SDL_opengl.h"
#include "../SDL_sysrender.h"
@@ -841,6 +841,6 @@
SDL_free(renderer);
}
-#endif /* SDL_VIDEO_RENDER_OGL */
+#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/opengles/SDL_render_gles.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/opengles/SDL_render_gles.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,7 +21,7 @@
*/
#include "SDL_config.h"
-#if SDL_VIDEO_RENDER_OGL_ES
+#if SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED
#include "SDL_opengles.h"
#include "../SDL_sysrender.h"
@@ -728,6 +728,6 @@
SDL_free(renderer);
}
-#endif /* SDL_VIDEO_RENDER_OGL_ES */
+#endif /* SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/opengles2/SDL_render_gles2.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/opengles2/SDL_render_gles2.c Tue Feb 08 10:04:09 2011 -0800
@@ -23,7 +23,7 @@
#include "SDL_config.h"
-#if SDL_VIDEO_RENDER_OGL_ES2
+#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
#include "SDL_opengles2.h"
#include "../SDL_sysrender.h"
@@ -1201,6 +1201,6 @@
return renderer;
}
-#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
+#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/opengles2/SDL_shaders_gles2.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/opengles2/SDL_shaders_gles2.c Tue Feb 08 10:04:09 2011 -0800
@@ -23,7 +23,7 @@
#include "SDL_config.h"
-#if SDL_VIDEO_RENDER_OGL_ES2
+#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
#include "SDL_video.h"
#include "SDL_opengles2.h"
@@ -539,6 +539,6 @@
}
}
-#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
+#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/software/SDL_blendfillrect.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/software/SDL_blendfillrect.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,6 +21,8 @@
*/
#include "SDL_config.h"
+#if !SDL_RENDER_DISABLED
+
#include "SDL_draw.h"
#include "SDL_blendfillrect.h"
@@ -345,4 +347,6 @@
return status;
}
+#endif /* !SDL_RENDER_DISABLED */
+
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/software/SDL_blendline.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/software/SDL_blendline.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,6 +21,8 @@
*/
#include "SDL_config.h"
+#if !SDL_RENDER_DISABLED
+
#include "SDL_draw.h"
#include "SDL_blendline.h"
#include "SDL_blendpoint.h"
@@ -779,4 +781,6 @@
return 0;
}
+#endif /* !SDL_RENDER_DISABLED */
+
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/software/SDL_blendpoint.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/software/SDL_blendpoint.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,6 +21,8 @@
*/
#include "SDL_config.h"
+#if !SDL_RENDER_DISABLED
+
#include "SDL_draw.h"
#include "SDL_blendpoint.h"
@@ -343,4 +345,6 @@
return status;
}
+#endif /* !SDL_RENDER_DISABLED */
+
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/software/SDL_drawline.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/software/SDL_drawline.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,6 +21,8 @@
*/
#include "SDL_config.h"
+#if !SDL_RENDER_DISABLED
+
#include "SDL_draw.h"
#include "SDL_drawline.h"
#include "SDL_drawpoint.h"
@@ -208,4 +210,6 @@
return 0;
}
+#endif /* !SDL_RENDER_DISABLED */
+
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/software/SDL_drawpoint.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/software/SDL_drawpoint.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,6 +21,8 @@
*/
#include "SDL_config.h"
+#if !SDL_RENDER_DISABLED
+
#include "SDL_draw.h"
#include "SDL_drawpoint.h"
@@ -114,4 +116,6 @@
return 0;
}
+#endif /* !SDL_RENDER_DISABLED */
+
/* vi: set ts=4 sw=4 expandtab: */
--- a/src/render/software/SDL_render_sw.c Mon Feb 07 22:57:33 2011 -0800
+++ b/src/render/software/SDL_render_sw.c Tue Feb 08 10:04:09 2011 -0800
@@ -21,6 +21,8 @@
*/
#include "SDL_config.h"
+#if !SDL_RENDER_DISABLED
+
#include "../SDL_sysrender.h"
#include "../../video/SDL_pixels_c.h"
@@ -428,4 +430,6 @@
SDL_free(renderer);
}
+#endif /* !SDL_RENDER_DISABLED */
+
/* vi: set ts=4 sw=4 expandtab: */