Having Issues with black flickering?

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

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.

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.


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+).

the book has to be read damit I really wish it didn’t have to be the book reading ahh man oh well