Jump to content
  • Advertisement
Sign in to follow this  
mike4

avoid flickering

This topic is 2587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Hidden
i only found examples using glut. but I don't want to use glut for some reasons.

Share this post


Link to post
currently I do:

glFlush();
display(); //draws the drops
void SDL_GL_SwapBuffers(void);

but still the same flickering. That's a shared lib (plugin for another app)
Any help? Many thanks
Michael

Share this post


Link to post
Share on other sites
I do alike below to draw rain drops in the display function:

if (temperatureC >= 0){
if (speedP >= 0.05){
glPushMatrix();
if (initT1 == 0){
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
XPLMBindTexture2d(gTexture[4], 0);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
}
// void SDL_GL_SwapBuffers(void);
glBegin(GL_QUADS);
glTexCoord2f(1, 1.0f); glVertex2f(X4achse[a]+15, Y4achse[a]-30); // Bottom Right Of The Texture and Quad
glTexCoord2f(0, 1.0f); glVertex2f(X4achse[a], Y4achse[a]-30); // Bottom Left Of The Texture and Quad
glTexCoord2f(0, 0.0f); glVertex2f(X4achse[a], Y4achse[a]); // Top Left Of The Texture and Quad
glTexCoord2f(1, 0.0f); glVertex2f(X4achse[a]+15, Y4achse[a]); // Top Right Of The Texture and Quad
glEnd();
initT1 = 1;
glPopMatrix();
X4achse[a] -= 0.5;
}else{
...

so drops get replaced slightly at each loop. ok but the drops seem to get invisible slightly before the new are drawn. ->flickering but i want them to fade out (best) after
drawn the new positions.
Many thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!