{
switch(config->video)
{
+ case AUTO_VIDEO:
+#ifdef HAVE_OPENGL
+ return new GL::Renderer();
+#else
+ return new SDL::Renderer();
+#endif
#ifdef HAVE_OPENGL
case OPENGL:
return new GL::Renderer();
return new SDL::Renderer();
default:
assert(0 && "invalid video system in config");
+#ifdef HAVE_OPENGL
+ return new GL::Renderer();
+#else
return new SDL::Renderer();
+#endif
}
}
{
switch(config->video)
{
+ case AUTO_VIDEO:
+#ifdef HAVE_OPENGL
+ return new GL::Lightmap();
+#else
+ return new SDL::Lightmap();
+#endif
#ifdef HAVE_OPENGL
case OPENGL:
return new GL::Lightmap();
return new SDL::Lightmap();
default:
assert(0 && "invalid video system in config");
+#ifdef HAVE_OPENGL
+ return new GL::Lightmap();
+#else
return new SDL::Lightmap();
+#endif
}
}
{
switch(config->video)
{
+ case AUTO_VIDEO:
+#ifdef HAVE_OPENGL
+ return new GL::Texture(image);
+#else
+ return new SDL::Texture(image);
+#endif
#ifdef HAVE_OPENGL
case OPENGL:
return new GL::Texture(image);
return new SDL::Texture(image);
default:
assert(0 && "invalid video system in config");
+#ifdef HAVE_OPENGL
+ return new GL::Texture(image);
+#else
return new SDL::Texture(image);
+#endif
}
}
{
switch(config->video)
{
+ case AUTO_VIDEO:
+#ifdef HAVE_OPENGL
+ return new GL::SurfaceData(surface);
+#else
+ return new SDL::SurfaceData(surface);
+#endif
#ifdef HAVE_OPENGL
case OPENGL:
return new GL::SurfaceData(surface);
return new SDL::SurfaceData(surface);
default:
assert(0 && "invalid video system in config");
+#ifdef HAVE_OPENGL
+ return new GL::SurfaceData(surface);
+#else
return new SDL::SurfaceData(surface);
+#endif
}
}
VideoSystem get_video_system(const std::string &video)
{
- if(0) {}
+ if(video == "auto")
+ {
+ return AUTO_VIDEO;
+ }
#ifdef HAVE_OPENGL
else if(video == "opengl")
{
}
else
{
-#ifdef HAVE_OPENGL
- return OPENGL;
-#else
- return PURE_SDL;
-#endif
+ return AUTO_VIDEO;
}
}
{
switch(video)
{
+ case AUTO_VIDEO:
+ return "auto";
case OPENGL:
return "opengl";
case PURE_SDL:
return "sdl";
default:
assert(0 && "invalid video system in config");
- return "sdl";
+ return "auto";
}
}