iDevGames Forums
GLUT Flickering - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: GLUT Flickering (/thread-1231.html)



GLUT Flickering - mikey - May 28, 2009 09:26 AM

I am creating a 3D game FPS, blah, blah, blah... BUT, when I run it my 'flats' (cuboids+imagination Rasp) go, all, flickery? Not really flickery, more like for a split-second the bottom half of the flat moves to the left, and vice versa. This only happens if I'm moving the mouse and keying w,s,a or d (movement). Is this something to do with framerates?

PS. I tried to record a video, but it goes back to normal when I record! This could be because the app slows down the CPU, or something else.
Huh


GLUT Flickering - scgames - May 28, 2009 10:24 AM

Is this in fullscreen or windowed mode? If windowed mode, do you have v-sync enabled?


GLUT Flickering - mikey - May 28, 2009 11:28 AM

It's fullscreen, but not anything special, just glutEnterFullScreen();


GLUT Flickering - scgames - May 28, 2009 11:54 AM

mikey Wrote:It's fullscreen, but not anything special, just glutEnterFullScreen();
Is v-sync enabled?


GLUT Flickering - AnotherJake - May 28, 2009 11:58 AM

To enable vsynch you can do this in main:

Code:
const GLint swapInterval = 1;
CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &swapInterval);

Also be sure to include OpenGL.h at the top of your file:

#include <OpenGL/OpenGL.h>


GLUT Flickering - mikey - May 28, 2009 12:06 PM

OK thanks _jyk_ and AnotherJake, I think I read about vertical synching before.