Mercurial > fife-parpg
diff engine/core/video/sdl/renderbackendsdl.cpp @ 641:52708806f35c
* Small fix for gcc on Linux. It didn't like passing a const char* to a function that requires a char*.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 07 Oct 2010 19:39:58 +0000 |
parents | 855ad500f991 |
children | 6e2151325017 |
line wrap: on
line diff
--- a/engine/core/video/sdl/renderbackendsdl.cpp Thu Oct 07 18:37:02 2010 +0000 +++ b/engine/core/video/sdl/renderbackendsdl.cpp Thu Oct 07 19:39:58 2010 +0000 @@ -35,6 +35,7 @@ #include "renderbackendsdl.h" #include "sdlimage.h" #include "SDL_image.h" +#include "SDL_getenv.h" namespace FIFE { static Logger _log(LM_VIDEO); @@ -54,9 +55,11 @@ } void RenderBackendSDL::init(const std::string& driver) { + char* buf; if (driver != "") { std::string envVar = std::string("SDL_VIDEODRIVER=") + driver; - SDL_putenv(envVar.c_str()); + buf = const_cast<char*>(envVar.c_str()); + putenv(buf); } if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)