View Full Version : Show drawing partically...

11-23-2005, 03:29 AM

I want draw the view partically: draw the first line and the user will see it, draw second line and the user will see both... and so on....

I use Tao in windows.

How can I do this?


11-23-2005, 04:14 AM
Draw the first line
Wait some time
Draw the second line
Wait some time
Draw the third line
Wait some time
etc ...

But I don't really thing that is really your question :)

11-23-2005, 04:22 AM

I mean:
first line - show it
second line - show both
third line - show 3 lines
last line - show all lines

I have tryed to use glFlush but it doesn't help me. I get the black screen an after it i get the all lines.

I am using Tao.

So how can I solve my problem?


11-23-2005, 05:41 AM
you have to use "swap buffers"; don't know the tao equivalent...

11-23-2005, 09:32 PM

The swap buffers helps me.


Dark Photon
11-28-2005, 03:12 AM
Or, just don't do double buffering? (i.e. remove GLX_DOUBLEBUFFER and/or GLUT_DOUBLE).

11-28-2005, 03:55 AM
Originally posted by Hampel:
you have to use "swap buffers"; don't know the tao equivalent...I am affraid it will work only if the "swap buffers" copies the contents of the back buffer to the front buffer. Otherwise, if the buffers are actually swapped, the resulting image ends up splattered between two buffers.
Use single buffering as in the previous post or call at startup the following code.

glDrawBuffer (GL_FRONT);I am not sure but I believe these can disable hardware acceleration in your application.

11-28-2005, 06:03 AM
Two things I think might be worth pointing out:

If using GL_FRONT with double buffering, followed by a swap, display will likely not be what OP wants. :) In the double buffering scenario it'd have to be GL_FRONT_AND_BACK. This will obviously be a slowdown, but inspecting the result OP wants this might actually be a good thing.

Revealing contents line-by-line (and vsynch'ing) could potentially take a LOT of time. Imagine running at 60Hz on 1280x1024. 1024/60 = over 17 seconds.

Now for my humble suggestion:
If I understood OP's question, the way I would do this would be to have the intended display result put in a texture (or perhaps not even that, if the scene is simple enough), then draw one full-screen quad with this texture, followed by a solid black or-whatever quad on top that "reveals" the image that's eventually to be displayed.