GLUT Flickering

Member
Posts: 281
Joined: 2009.04
Post: #1
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

~ Bring a Pen ~
Quote this message in a reply
Member
Posts: 63
Joined: 2005.12
Post: #2
Is this in fullscreen or windowed mode? If windowed mode, do you have v-sync enabled?
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #3
It's fullscreen, but not anything special, just glutEnterFullScreen();

~ Bring a Pen ~
Quote this message in a reply
Member
Posts: 63
Joined: 2005.12
Post: #4
mikey Wrote:It's fullscreen, but not anything special, just glutEnterFullScreen();
Is v-sync enabled?
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #5
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>
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #6
OK thanks _jyk_ and AnotherJake, I think I read about vertical synching before.

~ Bring a Pen ~
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  SDL Flickering LWStrike 2 3,358 Mar 31, 2006 11:50 PM
Last Post: PowerMacX
  SDL: Why is my sprite flickering? Snibril 10 5,201 Aug 27, 2003 07:11 PM
Last Post: belboz