Update non-doublebuffered SDL_GL window?

Hi there!

I am trying to draw & display a SDL_GL window
(using the SDL_OPENGL mode in SetVideoMode),
but I have no need for double-buffering since
it’s a really small application.

But: how to update the window, I mean tell
the window manager to update it? Or might it
be openGL that buffers command, in that case
how do I do a flush?

Obviously, SDL_GL_SwapBuffers sounds wrong, and
also didn’t work (as expected). I also tried
Locking + SDL_Updaterect(screen,0,0,0,0) with
no lock.

Thanks for any help,

/Olof

Olof Bjarnason wrote:

Hi there!

I am trying to draw & display a SDL_GL window
(using the SDL_OPENGL mode in SetVideoMode),
but I have no need for double-buffering since
it’s a really small application.

But: how to update the window, I mean tell
the window manager to update it? Or might it
be openGL that buffers command, in that case
how do I do a flush?

Using the OpenGL command glFlush(); or if you want a blocking flush,
using glFinish().

If you don’t see any update after some time, you are probably using
double-buffered opengl. Try the following to get single buffered OpenGL :
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 0 );

Also, using/not using SDL_DOUBLEBUF does not enable/disable OpenGL
double buffering, it’s just useful for 2D stuff.

Obviously, SDL_GL_SwapBuffers sounds wrong, and
also didn’t work (as expected). I also tried
Locking + SDL_Updaterect(screen,0,0,0,0) with
no lock.

SDL_GL_SwapBuffers is only for double buffered OpenGL, and
SDL_UpdateRect(s) is only for 2D blitting.

Stephane

glFlush() or glFinish() may be what you desire.

—> Drake WilsonOn Mon, Feb 23, 2004 at 11:08:33PM +0100, Olof Bjarnason wrote:

But: how to update the window, I mean tell
the window manager to update it? Or might it
be openGL that buffers command, in that case
how do I do a flush?