Jump to content
  • Advertisement
Sign in to follow this  
sefiroths

OpenGL refresh screen

This topic is 4853 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

hi, this is my problem: i draw about a milion of lines, when i pass on the screen opengl with another windows the screen is cancelled where the window passed, so i used glutdisplayfunc() and a subroutine that draw when a event occour, the problem is that the image is all redrawn and blink...have someone have an idea to avoid the problem?thankx, maurizio

Share this post


Link to post
Share on other sites
Advertisement
Well, if the problem is that you are seeing your scene flickering, then you probably need to enable double buffering.

First enable double buffering using:
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);

Then at the end of your render loop, swap the buffers:
glutSwapBuffers();

(more information on proper usage of glut can be found here:
http://www.gamedev.net/reference/articles/article1680.asp)


If instead your problem is that nothing is drawing, then perhaps your need a call glutPostRedisplay() (maybe at the end of your render loop). It has been a while since I last used GLUT, but give those a shot.

Hope this helps.

Share this post


Link to post
Share on other sites
i'm sorry for my bad english, the problem is flickering because i must redisplay the entire screen everytime a window pass on the screen, example:i have my program opened, then i open notepad and drag the notepad window on my program screen, this window act as a rubber, so i use a callback called every time another winwow drags on my program window, the result is flickering beacuse i have milion of line to display, i'll try double buffering, it is usual that a scene is to be redrawn when another window pass on it?(i use fortran...........)

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!