SDL Flickering

LWStrike
Unregistered
 
Post: #1
I have code refreshing at roughly 60frames per second (little bit more then that since floats arent perfect) and i notice some bad flickering SDL video has been inited with SDL_SWSURFACE | SDL_ANYFORMAT. I only call SDL_Flip() once per frame and i sleep directly after the line. (Then poll the SDL events). The windows version doesnt flicker at all. Did anyone else get that problem? i am on an intel mini using the curent CVS source (i dont know how to make a framework, so i directly include headers and libs with xcode).
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Use OpenGL and manually turn on vsync.
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #3
Specifically:
Code:
#include <OpenGL/OpenGL.h>
...
    // Call this once, after you have already have a valid OpenGL context.
    long swapInterval = 1;
    CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &swapInterval);
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GLUT Flickering mikey 5 3,570 May 28, 2009 12:06 PM
Last Post: mikey
  SDL: Why is my sprite flickering? Snibril 10 5,159 Aug 27, 2003 07:11 PM
Last Post: belboz