Skip to main content
GameDev.net gamedev.net
🔒 Locked

refresh screen

Started by sefiroths Dec 2, 2005 at 6:58 AM 2 replies 800+ views
Original Post
sefiroths
sefiroths
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
Undeadlnsanity
Undeadlnsanity
I don't understand your grammar, could you rephrase it or even show us a screenshot please?
Nit
Nit
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.
sefiroths
sefiroths
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...........)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.