PDA

View Full Version : glFlush() Problem



Erakis
10-25-2001, 09:43 PM
When I draw triangle moving, scalling, rotating on a Windows (single buffer), I got
flicked effet !!!

Pixel format declaration :
............................................
dwFlags = PFD_DOUBLEBUFFER | | PFD_DRAW_TO_WINDOW | | PFD_SUPPORT_OPENGL
nVersion = 1;
cColorBits = 16;
CdepthBits = 16;
.............................................

At the end of my OpenGL command I just use the glFlush(); command...
If I well understand I don't have to use SwapBuffers cause I specify that my pixel format descriptor doesn't support the Double Buffer ?
But why I got this flick effect ? If I activate the Double buffer, the effect disapear.


I have a GeForceČ GTS Pro 32Mo DDR
Athlon 1.2Ghz

Thank in advance.

T2k
10-25-2001, 11:39 PM
thats normal in singlebuffer mode(you see your drawing when it occurs and that is the flickering), you have to use doublebuffer if you dont want to have flickering!
dont use | | instead use |, i dont know where the difference is but all books and coders(i think) use a single OR by combining flags.

Tron
10-26-2001, 01:21 AM
Originally posted by Erakis:
Pixel format declaration :
............................................
dwFlags = PFD_DOUBLEBUFFER | | PFD_DRAW_TO_WINDOW | | PFD_SUPPORT_OPENGL
nVersion = 1;
cColorBits = 16;
CdepthBits = 16;
.............................................

At the end of my OpenGL command I just use the glFlush(); command...
If I well understand I don't have to use SwapBuffers cause I specify that my pixel format descriptor doesn't support the Double Buffer ?


eh? PFD_DOUBLEBUFFER means that you use doublebuffering, so you have to use SwapBuffers()

oh... your dw_flags are WRONG, you use the logical or ( | | ), that's for boolean operations, so in your case your dw_flags contains a senseless value (or at least not what you want)
you have to use the bitwise or ( | ) then all should work fine, including the doublebuffer