Mercurial > fife-parpg
comparison 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 |
comparison
equal
deleted
inserted
replaced
639:685d250f2c2d | 640:855ad500f991 |
---|---|
51 const std::string& RenderBackendSDL::getName() const { | 51 const std::string& RenderBackendSDL::getName() const { |
52 static std::string backend_name = "SDL"; | 52 static std::string backend_name = "SDL"; |
53 return backend_name; | 53 return backend_name; |
54 } | 54 } |
55 | 55 |
56 void RenderBackendSDL::init() { | 56 void RenderBackendSDL::init(const std::string& driver) { |
57 if (driver != "") { | |
58 std::string envVar = std::string("SDL_VIDEODRIVER=") + driver; | |
59 SDL_putenv(envVar.c_str()); | |
60 } | |
61 | |
57 if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) | 62 if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) |
58 throw SDLException(SDL_GetError()); | 63 throw SDLException(SDL_GetError()); |
59 | 64 |
60 SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); // temporary hack | 65 SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); // temporary hack |
61 } | 66 } |