PDA

View Full Version : Having Issues with black flickering?



noobscratcher
12-25-2011, 07:16 AM
When I run my game and SDL_GL_SwapBuffers(); every frame of mario sprite which you can see in this the hole video

<object width="425" height="350"> <param name="movie" value="http://www.youtube.com/v/XjJWidr3pBY"></param> <param name="wmode" value="transparent"></param> <embed src="http://www.youtube.com/v/XjJWidr3pBY" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"> </embed></object>

the screen flickers black and I really need that to stop and I don't know how too keep redrawing the scene without it crashing the application because of a While Loop

I have ideas to use another thread and put a while loop in there maybe that may stop the crashing but cause a crash because of too much of the same thing happening I don't know but I really need someone to help me out here please

mobeen
12-25-2011, 11:56 AM
Seems like you are not using double buffering or you are clearing screen after drawing the background which removes it before Mario is rendered.

Without any more info. I am afraid none of us can help you.

noobscratcher
12-25-2011, 01:38 PM
I'm using OpenGL 3.3 , SDL 1.2 I'm using SDL_GL_SwapBuffers(); to swap the buffers every frame of texture on the quad that's whats causing the flickering but if I remove that opengl doesn't update the animation every frame it doesn't show anything but If I use SDL_GL_SwapBuffers(); then it does the black flickering and shows the animation but the background textured quad goes black every swapbuffer

what more information do you need

SDL is used then after the titlescreen everything is done in opengl accept the textures themselfs which are image loaded into sdl surfaces and then through opengl there loaded onto quads.

noobscratcher
12-26-2011, 02:54 AM
anyone?

_arts_
12-26-2011, 03:45 AM
From this and other topics you made, I highly suggest you to read some OpenGL tutorials. Nehe was and is very well known (http://nehe.gamedev.net/), but there are others, like the one Alfonse makes (AFAIK it only covers GL 3+).

noobscratcher
12-26-2011, 04:00 AM
the book has to be read damit I really wish it didn't have to be the book reading ahh man oh well