Mercurial > fife-parpg
diff engine/core/video/sdl/renderbackendsdl.cpp @ 640:855ad500f991
* Added the ability to set/get the video driver used using the settings interface. Note that the default driver for the OS will be used unless explicitly specified.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 07 Oct 2010 18:37:02 +0000 |
parents | 5f381fa34769 |
children | 52708806f35c |
line wrap: on
line diff
--- a/engine/core/video/sdl/renderbackendsdl.cpp Thu Oct 07 16:44:44 2010 +0000 +++ b/engine/core/video/sdl/renderbackendsdl.cpp Thu Oct 07 18:37:02 2010 +0000 @@ -53,7 +53,12 @@ return backend_name; } - void RenderBackendSDL::init() { + void RenderBackendSDL::init(const std::string& driver) { + if (driver != "") { + std::string envVar = std::string("SDL_VIDEODRIVER=") + driver; + SDL_putenv(envVar.c_str()); + } + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) throw SDLException(SDL_GetError());