Screen Flicker Problem


p0is0n

Still Fresh
Joined
Aug 29, 2007
Messages
24
Age
38
Location
UK
Website
Visit site
Hi guys,

When i use:

m_screen = SDL_SetVideoMode(screenWidth, screenHeight, screenDepth, SDL_HWSURFACE | SDL_DOUBLEBUF);

and run my game the screen flickers, when i pass in SDL_SWSURFACE i dont get this problem. I did a search but couldnt find anything that fixed my problem (maybe i missed something :unsure: ) but am a bit stuck.

When i use SDL_HWSURFACE | SDL_DOUBLEBUF i get just over 400 fps, with the other i get just under 200 fps, so as you can guess i would rather fix the screen flicker than just use SDL_SWSURFACE instead.

Any help on this would be great!
Thanks in advance!!!
 
In my render i do:
Clear Screen -> SDL_FillRect(m_screen, NULL, SDL_MapRGB(m_screen->format, 0, 0, 0))
Render All Sprites -> SDL_BlitSurface(m_sprite, m_spriteRect, m_screen, &pos)
Flip -> SDL_Flip(m_screen)

I'm checking all return values and nothing fails
 
My screen depth is 16.

Just thought i'd give an update to this:
Using double buffering and clearing the screen makes my screen flicker, i dont get the problem if i dont clear the screen and just redraw my game tiles.
Just incase anyone else comes across the thread with the same problem!
 
Back
Top