Hello, I wonder if using SDL “could” slow down an opengl app ?
I mean, I use sdl mostly for sound and input but SDL handle the buffer
swapping.
Or may be, something could be wrong with the way I init SDL ?
- sdl init come first (see below)
- then ogl init
- then in the mainloop the only SDL function used is SDL_GL_SwapBuffers()
Thank you
void SDLInitialisation() throw (CException)
{
if(SDL_Init(SDL_INIT_EVERYTHING)<0)
THROW("SDL Init error " + string(SDL_GetError()));
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); // tell SDL that the GL
drawing is going to be double buffered
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE,32); // size of depth
buffer
SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 0); // we aren’t going to
use the stencil buffer
SDL_GL_SetAttribute( SDL_GL_ACCUM_RED_SIZE, 0); // this and the next
three lines set the bits allocated per pixel -
SDL_GL_SetAttribute( SDL_GL_ACCUM_GREEN_SIZE, 0); // - for the
accumulation buffer to 0
SDL_GL_SetAttribute( SDL_GL_ACCUM_BLUE_SIZE, 0);
SDL_GL_SetAttribute( SDL_GL_ACCUM_ALPHA_SIZE, 0);
MainWindow = SDL_SetVideoMode(gWindowWidth,gWindowHeight,32,SDL_OPENGL |
SDL_HWSURFACE | SDL_DOUBLEBUF);
if(MainWindow == NULL)
THROW("SDL MainWindow is null - " + string(SDL_GetError()));
}___________________________________________________________
Do You Yahoo!? – Une adresse @yahoo.fr gratuite et en fran?ais !
Yahoo! Mail : http://fr.mail.yahoo.com