Mercurial > fife-parpg
comparison engine/core/video/opengl/renderbackendopengl.cpp @ 59:129d3dafd3a5
fix initialization of opengl, SDL_GL_DOUBLEBUFFER was accidently used as flag for SDL_SetVideoMode, instead it has to be used with SDL_GL_SetAttribute, thanks to austin_, who reported that.
author | spq@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Tue, 15 Jul 2008 15:34:47 +0000 |
parents | 90005975cdbb |
children | 18c2a21ac0ad |
comparison
equal
deleted
inserted
replaced
58:9ec572a5a944 | 59:129d3dafd3a5 |
---|---|
55 | 55 |
56 void RenderBackendOpenGL::init() { | 56 void RenderBackendOpenGL::init() { |
57 Uint32 flags = SDL_INIT_VIDEO; | 57 Uint32 flags = SDL_INIT_VIDEO; |
58 if (SDL_InitSubSystem(flags) < 0) | 58 if (SDL_InitSubSystem(flags) < 0) |
59 throw SDLException(SDL_GetError()); | 59 throw SDLException(SDL_GetError()); |
60 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); | |
60 | 61 |
61 SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); // temporary hack | 62 SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); // temporary hack |
62 } | 63 } |
63 | 64 |
64 Image* RenderBackendOpenGL::createMainScreen(unsigned int width, unsigned int height, unsigned char bitsPerPixel, bool fs) { | 65 Image* RenderBackendOpenGL::createMainScreen(unsigned int width, unsigned int height, unsigned char bitsPerPixel, bool fs) { |
65 delete m_screen; | 66 delete m_screen; |
66 m_screen = 0; | 67 m_screen = 0; |
67 | 68 |
68 Uint32 flags = SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_HWPALETTE | SDL_HWACCEL; | 69 Uint32 flags = SDL_OPENGL | SDL_HWPALETTE | SDL_HWACCEL; |
69 if ( fs ) { | 70 if ( fs ) { |
70 flags |= SDL_FULLSCREEN; | 71 flags |= SDL_FULLSCREEN; |
71 } | 72 } |
72 | 73 |
73 SDL_Surface* screen = NULL; | 74 SDL_Surface* screen = NULL; |