SDL_GL_SwapBuffers issue on program start

SuSE 10.0: 2.6.13-15.7-default

NVRM version: NVIDIA Linux x86 NVIDIA Kernel Module 1.0-8178 Wed Dec
14 16:22:51 PST 2005
GCC version: gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)

SDL 1.2.8

xorg-x11 6.8.2

Currently working with NeHe and ‘SuperBible’ examples.

Here’s the problem:

On program start, frame rate is hideously low and all frames seem to be
limited to a quick burst followed by a pause of about half a second,
then another burst.

I switch to fullscreen mode and the problem goes away and everything
displays as it should. I switch back to windowed mode and it stays fine.

This only occurs when the SwapBuffers command is within a particular
if/else statement whether I use glAccum or not, if I comment out the
if/else lines or use glAccum in a for loop /then/ call SwapBuffers it’s
fine.

Also, if anyone knows any better OpenGL examples/tutorials that’d be
nifty; I find it slightly hard to take a book entirely seriously when
the example code rejects OpenGL 2.0 as ‘not sufficient’ because it
doesn’t return ‘1’ as a major version number.

Code attached, don’t expect it to compile with the standard SuperBible
files (it might, but I can’t be sure) as I’ve messed around with those;
I’ll attach the bin if anyone really wants to see it for themselves.

TIA, Paul
-------------- next part --------------
A non-text attachment was scrubbed…
Name: test.cpp
Type: text/x-c++src
Size: 7121 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060128/8411e65e/attachment.cpp

Try inserting a ‘SDL_Delay(10);’ into the main loop, to give the OS a
little
breathing room.

  • GerryOn Sat, 28 Jan 2006 21:22:32 +0100, Paul Duffy wrote:

On program start, frame rate is hideously low and all frames seem to be
limited to a quick burst followed by a pause of about half a second,
then another burst.

Marvellous, thanks.

Is there any reason for the flicker I’m getting or would it just be
better to render fractions of frames to a SDL surface or GL texture and
blit that to the screen?On Sat, 2006-01-28 at 22:06 +0100, Gerry JJ wrote:

On Sat, 28 Jan 2006 21:22:32 +0100, Paul Duffy <@Paul_Duffy> wrote:

On program start, frame rate is hideously low and all frames seem to be
limited to a quick burst followed by a pause of about half a second,
then another burst.

Try inserting a ‘SDL_Delay(10);’ into the main loop, to give the OS a
little
breathing room.


Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com