glClear locks system

Started by
13 comments, last by Seabolt 13 years, 1 month ago
Fixed it by adding glFlush after I swap buffers. Anyone have any idea why that works?
Perception is when one imagination clashes with another
Advertisement
The only explanation I have is this one:

Render commands that are send to OpenGL are not executed immediately but enqueued and executed later. When you send a command that will alter a resource that is still locked by a previous command, then blocking will occur. Perhaps the current backbuffer is such a resource w.r.t. glClear. Now, glFlush instructs OpenGL to execute all pending commands as quick as possible. Therefore it is meaningful to send a glFlush (but not a glFinish in this case) before swapping buffers.

However, even without glFlush I would expect OpenGL to do its job, even if perhaps not at as performant as possible.
Right, and that's why I'm trying to eliminate the glFlush() call.

What do you mean by w.r.t glClear() though?

Sorry I've never heard that acronym.

I do believe that somewhere the call is being blocked because when I run the program through glDEBugger I get some where in the tens of thousands of calls to the context in a frame, when all I call is two gl functions. Something is up there, I just can't seem to figure out what is eating all of those calls.

Perception is when one imagination clashes with another
WHere is your winMain that translates messages? I could give you a more basic gl framework for you to use.

And I never render on WM_PAINT, I always render.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal



// Start the message loop
MSG msg;
while( CGame::GetInstance()->IsGameActive() )
{
if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
if( msg.message == WM_QUIT )
{
break;
}

TranslateMessage( &msg );
DispatchMessage( &msg );
}
else if( CGame::GetInstance()->IsGameActive() )
{
CGame::GetInstance()->Update();
CGame::GetInstance()->Render();
}
}





Perception is when one imagination clashes with another

This topic is closed to new replies.

Advertisement