Made it possible to disable the rendering subsystem with configure --disable-render
authorSam Lantinga <slouken@libsdl.org>
Tue, 08 Feb 2011 10:04:09 -0800
changeset 5226710d00cb3a6a
parent 5225 5d01d426f2ea
child 5227 9c0c4d767ef6
Made it possible to disable the rendering subsystem with configure --disable-render
configure.in
include/SDL_config.h.in
src/render/SDL_render.c
src/render/SDL_sysrender.h
src/render/direct3d/SDL_render_d3d.c
src/render/opengl/SDL_render_gl.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
src/render/opengles2/SDL_shaders_gles2.c
src/render/software/SDL_blendfillrect.c
src/render/software/SDL_blendline.c
src/render/software/SDL_blendpoint.c
src/render/software/SDL_drawline.c
src/render/software/SDL_drawpoint.c
src/render/software/SDL_render_sw.c
     1.1 --- a/configure.in	Mon Feb 07 22:57:33 2011 -0800
     1.2 +++ b/configure.in	Tue Feb 08 10:04:09 2011 -0800
     1.3 @@ -362,6 +362,12 @@
     1.4  if test x$enable_video != xyes; then
     1.5      AC_DEFINE(SDL_VIDEO_DISABLED)
     1.6  fi
     1.7 +AC_ARG_ENABLE(render,
     1.8 +AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]),
     1.9 +              , enable_render=yes)
    1.10 +if test x$enable_render != xyes; then
    1.11 +    AC_DEFINE(SDL_RENDER_DISABLED)
    1.12 +fi
    1.13  AC_ARG_ENABLE(events,
    1.14  AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
    1.15                , enable_events=yes)
     2.1 --- a/include/SDL_config.h.in	Mon Feb 07 22:57:33 2011 -0800
     2.2 +++ b/include/SDL_config.h.in	Tue Feb 08 10:04:09 2011 -0800
     2.3 @@ -179,6 +179,7 @@
     2.4  #undef SDL_JOYSTICK_DISABLED
     2.5  #undef SDL_HAPTIC_DISABLED
     2.6  #undef SDL_LOADSO_DISABLED
     2.7 +#undef SDL_RENDER_DISABLED
     2.8  #undef SDL_THREADS_DISABLED
     2.9  #undef SDL_TIMERS_DISABLED
    2.10  #undef SDL_VIDEO_DISABLED
     3.1 --- a/src/render/SDL_render.c	Mon Feb 07 22:57:33 2011 -0800
     3.2 +++ b/src/render/SDL_render.c	Tue Feb 08 10:04:09 2011 -0800
     3.3 @@ -45,6 +45,7 @@
     3.4  
     3.5  
     3.6  static const SDL_RenderDriver *render_drivers[] = {
     3.7 +#if !SDL_RENDER_DISABLED
     3.8  #if SDL_VIDEO_RENDER_D3D
     3.9      &D3D_RenderDriver,
    3.10  #endif
    3.11 @@ -61,6 +62,7 @@
    3.12      &DirectFB_RenderDriver,
    3.13  #endif
    3.14      &SW_RenderDriver
    3.15 +#endif /* !SDL_RENDER_DISABLED */
    3.16  };
    3.17  static char renderer_magic;
    3.18  static char texture_magic;
    3.19 @@ -170,7 +172,12 @@
    3.20  SDL_Renderer *
    3.21  SDL_CreateSoftwareRenderer(SDL_Surface * surface)
    3.22  {
    3.23 +#if !SDL_RENDER_DISABLED
    3.24      return SW_CreateRendererForSurface(surface);
    3.25 +#else
    3.26 +    SDL_SetError("SDL not built with rendering support");
    3.27 +    return NULL;
    3.28 +#endif /* !SDL_RENDER_DISABLED */
    3.29  }
    3.30  
    3.31  int
     4.1 --- a/src/render/SDL_sysrender.h	Mon Feb 07 22:57:33 2011 -0800
     4.2 +++ b/src/render/SDL_sysrender.h	Tue Feb 08 10:04:09 2011 -0800
     4.3 @@ -119,6 +119,8 @@
     4.4      SDL_RendererInfo info;
     4.5  };
     4.6  
     4.7 +#if !SDL_RENDER_DISABLED
     4.8 +
     4.9  #if SDL_VIDEO_RENDER_D3D
    4.10  extern SDL_RenderDriver D3D_RenderDriver;
    4.11  #endif
    4.12 @@ -136,6 +138,8 @@
    4.13  #endif
    4.14  extern SDL_RenderDriver SW_RenderDriver;
    4.15  
    4.16 +#endif /* !SDL_RENDER_DISABLED */
    4.17 +
    4.18  #endif /* _SDL_sysrender_h */
    4.19  
    4.20  /* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/src/render/direct3d/SDL_render_d3d.c	Mon Feb 07 22:57:33 2011 -0800
     5.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Tue Feb 08 10:04:09 2011 -0800
     5.3 @@ -21,7 +21,8 @@
     5.4  */
     5.5  #include "SDL_config.h"
     5.6  
     5.7 -#if SDL_VIDEO_RENDER_D3D
     5.8 +#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
     5.9 +
    5.10  
    5.11  #include "../../core/windows/SDL_windows.h"
    5.12  
    5.13 @@ -1066,6 +1067,6 @@
    5.14      SDL_free(renderer);
    5.15  }
    5.16  
    5.17 -#endif /* SDL_VIDEO_RENDER_D3D */
    5.18 +#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
    5.19  
    5.20  /* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/render/opengl/SDL_render_gl.c	Mon Feb 07 22:57:33 2011 -0800
     6.2 +++ b/src/render/opengl/SDL_render_gl.c	Tue Feb 08 10:04:09 2011 -0800
     6.3 @@ -21,7 +21,7 @@
     6.4  */
     6.5  #include "SDL_config.h"
     6.6  
     6.7 -#if SDL_VIDEO_RENDER_OGL
     6.8 +#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED
     6.9  
    6.10  #include "SDL_opengl.h"
    6.11  #include "../SDL_sysrender.h"
    6.12 @@ -841,6 +841,6 @@
    6.13      SDL_free(renderer);
    6.14  }
    6.15  
    6.16 -#endif /* SDL_VIDEO_RENDER_OGL */
    6.17 +#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */
    6.18  
    6.19  /* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/render/opengles/SDL_render_gles.c	Mon Feb 07 22:57:33 2011 -0800
     7.2 +++ b/src/render/opengles/SDL_render_gles.c	Tue Feb 08 10:04:09 2011 -0800
     7.3 @@ -21,7 +21,7 @@
     7.4  */
     7.5  #include "SDL_config.h"
     7.6  
     7.7 -#if SDL_VIDEO_RENDER_OGL_ES
     7.8 +#if SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED
     7.9  
    7.10  #include "SDL_opengles.h"
    7.11  #include "../SDL_sysrender.h"
    7.12 @@ -728,6 +728,6 @@
    7.13      SDL_free(renderer);
    7.14  }
    7.15  
    7.16 -#endif /* SDL_VIDEO_RENDER_OGL_ES */
    7.17 +#endif /* SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED */
    7.18  
    7.19  /* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/render/opengles2/SDL_render_gles2.c	Mon Feb 07 22:57:33 2011 -0800
     8.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Tue Feb 08 10:04:09 2011 -0800
     8.3 @@ -23,7 +23,7 @@
     8.4  
     8.5  #include "SDL_config.h"
     8.6  
     8.7 -#if SDL_VIDEO_RENDER_OGL_ES2
     8.8 +#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
     8.9  
    8.10  #include "SDL_opengles2.h"
    8.11  #include "../SDL_sysrender.h"
    8.12 @@ -1201,6 +1201,6 @@
    8.13      return renderer;
    8.14  }
    8.15  
    8.16 -#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
    8.17 +#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
    8.18  
    8.19  /* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/render/opengles2/SDL_shaders_gles2.c	Mon Feb 07 22:57:33 2011 -0800
     9.2 +++ b/src/render/opengles2/SDL_shaders_gles2.c	Tue Feb 08 10:04:09 2011 -0800
     9.3 @@ -23,7 +23,7 @@
     9.4  
     9.5  #include "SDL_config.h"
     9.6  
     9.7 -#if SDL_VIDEO_RENDER_OGL_ES2
     9.8 +#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
     9.9  
    9.10  #include "SDL_video.h"
    9.11  #include "SDL_opengles2.h"
    9.12 @@ -539,6 +539,6 @@
    9.13      }
    9.14  }
    9.15  
    9.16 -#endif /* SDL_VIDEO_RENDER_OGL_ES2 */
    9.17 +#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */
    9.18  
    9.19  /* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/render/software/SDL_blendfillrect.c	Mon Feb 07 22:57:33 2011 -0800
    10.2 +++ b/src/render/software/SDL_blendfillrect.c	Tue Feb 08 10:04:09 2011 -0800
    10.3 @@ -21,6 +21,8 @@
    10.4  */
    10.5  #include "SDL_config.h"
    10.6  
    10.7 +#if !SDL_RENDER_DISABLED
    10.8 +
    10.9  #include "SDL_draw.h"
   10.10  #include "SDL_blendfillrect.h"
   10.11  
   10.12 @@ -345,4 +347,6 @@
   10.13      return status;
   10.14  }
   10.15  
   10.16 +#endif /* !SDL_RENDER_DISABLED */
   10.17 +
   10.18  /* vi: set ts=4 sw=4 expandtab: */
    11.1 --- a/src/render/software/SDL_blendline.c	Mon Feb 07 22:57:33 2011 -0800
    11.2 +++ b/src/render/software/SDL_blendline.c	Tue Feb 08 10:04:09 2011 -0800
    11.3 @@ -21,6 +21,8 @@
    11.4  */
    11.5  #include "SDL_config.h"
    11.6  
    11.7 +#if !SDL_RENDER_DISABLED
    11.8 +
    11.9  #include "SDL_draw.h"
   11.10  #include "SDL_blendline.h"
   11.11  #include "SDL_blendpoint.h"
   11.12 @@ -779,4 +781,6 @@
   11.13      return 0;
   11.14  }
   11.15  
   11.16 +#endif /* !SDL_RENDER_DISABLED */
   11.17 +
   11.18  /* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/render/software/SDL_blendpoint.c	Mon Feb 07 22:57:33 2011 -0800
    12.2 +++ b/src/render/software/SDL_blendpoint.c	Tue Feb 08 10:04:09 2011 -0800
    12.3 @@ -21,6 +21,8 @@
    12.4  */
    12.5  #include "SDL_config.h"
    12.6  
    12.7 +#if !SDL_RENDER_DISABLED
    12.8 +
    12.9  #include "SDL_draw.h"
   12.10  #include "SDL_blendpoint.h"
   12.11  
   12.12 @@ -343,4 +345,6 @@
   12.13      return status;
   12.14  }
   12.15  
   12.16 +#endif /* !SDL_RENDER_DISABLED */
   12.17 +
   12.18  /* vi: set ts=4 sw=4 expandtab: */
    13.1 --- a/src/render/software/SDL_drawline.c	Mon Feb 07 22:57:33 2011 -0800
    13.2 +++ b/src/render/software/SDL_drawline.c	Tue Feb 08 10:04:09 2011 -0800
    13.3 @@ -21,6 +21,8 @@
    13.4  */
    13.5  #include "SDL_config.h"
    13.6  
    13.7 +#if !SDL_RENDER_DISABLED
    13.8 +
    13.9  #include "SDL_draw.h"
   13.10  #include "SDL_drawline.h"
   13.11  #include "SDL_drawpoint.h"
   13.12 @@ -208,4 +210,6 @@
   13.13      return 0;
   13.14  }
   13.15  
   13.16 +#endif /* !SDL_RENDER_DISABLED */
   13.17 +
   13.18  /* vi: set ts=4 sw=4 expandtab: */
    14.1 --- a/src/render/software/SDL_drawpoint.c	Mon Feb 07 22:57:33 2011 -0800
    14.2 +++ b/src/render/software/SDL_drawpoint.c	Tue Feb 08 10:04:09 2011 -0800
    14.3 @@ -21,6 +21,8 @@
    14.4  */
    14.5  #include "SDL_config.h"
    14.6  
    14.7 +#if !SDL_RENDER_DISABLED
    14.8 +
    14.9  #include "SDL_draw.h"
   14.10  #include "SDL_drawpoint.h"
   14.11  
   14.12 @@ -114,4 +116,6 @@
   14.13      return 0;
   14.14  }
   14.15  
   14.16 +#endif /* !SDL_RENDER_DISABLED */
   14.17 +
   14.18  /* vi: set ts=4 sw=4 expandtab: */
    15.1 --- a/src/render/software/SDL_render_sw.c	Mon Feb 07 22:57:33 2011 -0800
    15.2 +++ b/src/render/software/SDL_render_sw.c	Tue Feb 08 10:04:09 2011 -0800
    15.3 @@ -21,6 +21,8 @@
    15.4  */
    15.5  #include "SDL_config.h"
    15.6  
    15.7 +#if !SDL_RENDER_DISABLED
    15.8 +
    15.9  #include "../SDL_sysrender.h"
   15.10  #include "../../video/SDL_pixels_c.h"
   15.11  
   15.12 @@ -428,4 +430,6 @@
   15.13      SDL_free(renderer);
   15.14  }
   15.15  
   15.16 +#endif /* !SDL_RENDER_DISABLED */
   15.17 +
   15.18  /* vi: set ts=4 sw=4 expandtab: */