Why do I need to glFlush?
Hello everyone on the forum, first time poster so please be gentle. 
I'm having a problem with my home project OpenGL game I'm working on.
For some reason I have to do a glFlush() or the game screen won't display. The stuff I've read seems to say I don't need to and in fact shouldn't as the program will hang about for ages syncing with OGL. Which is what it does.
The code I've written works on OS X and WINDERS (on which I don't need to do a flush) and the majority is platform independent.
I've zipped up my OS X specfic code which you can see here. I do the flush on line 101 in NSOpenGLView.mm You can find the file here:
http://www.blockcopycoders.com/temp/mac.zip
Any help very gratefully received, it'd be nice to get the time back the glFlush is consuming
gaz

I'm having a problem with my home project OpenGL game I'm working on.
For some reason I have to do a glFlush() or the game screen won't display. The stuff I've read seems to say I don't need to and in fact shouldn't as the program will hang about for ages syncing with OGL. Which is what it does.
The code I've written works on OS X and WINDERS (on which I don't need to do a flush) and the majority is platform independent.
I've zipped up my OS X specfic code which you can see here. I do the flush on line 101 in NSOpenGLView.mm You can find the file here:
http://www.blockcopycoders.com/temp/mac.zip
Any help very gratefully received, it'd be nice to get the time back the glFlush is consuming

gaz
Hello!
I just wanted to post again to say I'm an idiot
I hadn't set the NSOpenGLView to be double buffered in the NIB
I've done that and it all works nicely now
Sorry for the time waste
gaz
I just wanted to post again to say I'm an idiot

I hadn't set the NSOpenGLView to be double buffered in the NIB
I've done that and it all works nicely now

Sorry for the time waste

gaz
Are you using single buffering by accident? When using double buffering you rarely ever need to call glFlush(). As you've found, the common wisdom is that if you do need to call flush then you are probably doing something wrong.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Cheers man 
I did spot my error prior to your helpful reply and post here about but being a n00b my post had to be okayed by a moderator so its only just appeared.
Shark not reporting any time lost in glFlush now so I'm a happy camper
gaz

I did spot my error prior to your helpful reply and post here about but being a n00b my post had to be okayed by a moderator so its only just appeared.
Shark not reporting any time lost in glFlush now so I'm a happy camper

gaz
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| about getting rid of glFlush() | ylaporte | 11 | 5,276 |
Nov 4, 2002 10:59 AM Last Post: Feanor |
|

