SDL slow down?

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

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.

It shouldn’t. What behavior are you seeing?

Note that some people have reported that they need to call glFinish()
before calling SDL_GL_SwapBuffers(), specifically with the Linux ATI
drivers.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Ho, nothing particular… I was just wondering what SDL is doing being
SDL_GL_SwapBuffers. The global slow down came from the way I feed the opengl
API. Now it’s better and I need to optimize my calls (many many C++
way-of-code calls)…> ----- Original Message -----

From: slouken@devolution.com (Sam Lantinga)
To:
Sent: Sunday, December 01, 2002 11:34 PM
Subject: Re: [SDL] SDL slow down ?

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.

It shouldn’t. What behavior are you seeing?

Note that some people have reported that they need to call glFinish()
before calling SDL_GL_SwapBuffers(), specifically with the Linux ATI
drivers.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do You Yahoo!? – Une adresse @yahoo.fr gratuite et en fran?ais !
Yahoo! Mail : http://fr.mail.yahoo.com