PDA

View Full Version : "Please Wait" screens



Gus
03-29-2001, 02:25 AM
I just wondered if anyone could point me in the direction of any demos which show how to have a "Please Wait While Rendering" progress bar appear at the start of your app. I have been told that this is usually done using 'Windows Programming'.

Thanks in advance. http://www.opengl.org/discussion_boards/ubb/smile.gif


[This message has been edited by Gus (edited 03-29-2001).]

AndersO
03-29-2001, 05:09 AM
This is one of them crazy questions..

You want to know how to show a windows gdi bar or do you want to render it with opengl?

Move to google.com and search on "windows programming"

Gus
03-29-2001, 08:47 AM
Due to the nature of this discussion forum, I would have thought most readers would have assumed the latter... quite obviously not!

BwB
03-29-2001, 10:54 AM
What exactly do you mean by "Please Wait for Rendering"? What exactly are you doing? You need to put a render loop inside your rendering loop. The inner render loop will keep track of percentage and update a graphical representation (A 2d bar?). The outer rendering loop does whatever work you need done you called it "rendering".

Gus
03-29-2001, 12:14 PM
ok, you seemed not to have understood me very well. Nevertheless, your advice... was greatly appreciated. To clear up anything misunderstood, the term 'rendering' in this context was referred to the period of time when the scene objects are compiled into mem from various sources (display lists etc). Okay, it is not true 'rendering' but then what would you call it? Either way, the pedantic nature of this is not important.

chennes
03-29-2001, 12:34 PM
Regardless, you need to set up some sort of counter that gets incremented at a regular interval within whatever loop you are running. Drawing it in GL is then just a matter of computing the length of the bar based on that number and the maximum that it will reach.

Chris

Elixer
03-29-2001, 10:05 PM
Hmm, at first I was thinking that he meant how do you have a animation/progress bar playing while loading in the data...

Guess not.

AndersO
03-30-2001, 12:47 AM
Well, if you can compile a displaylist, showing a 2D bar in OpenGL should be a breeze! http://www.opengl.org/discussion_boards/ubb/smile.gif

Compile list1
Increase bar
Compile list2
Increase bar
Load texture or whatever
increase bar
.
.
.


Or do you want to update the bar during the list is compiling or during whatever?. That would be trickier, but since compiling a list takes a fraction of a second (well, usually I guess), it would serve no point.

Cheers.

Gus
03-30-2001, 03:02 AM
Thanks for your reply once again. I see what you mean about compile list...update progress bar etc but the problem I am having as you anticipated is updating the progress bar whilst each list is actually compiling. I have 50+ lists in my app, each one containing an avg 10k mesh points. When running something like this on a low spec machine, the time taken for the lists to be compiled, sometimes leads the user to believe that the app has crashed. The real problem I am having is actually flushing the buffer to the screen, whilst the lists are still being compiled....

cheers
Gus.

chennes
03-30-2001, 05:48 AM
I'm pretty sure that that's not possible, at least not using OpenGL. Once you go into GL_COMPILE, all of the GL commands are going into the DL (well, those that can, anyway). You will probably need to use something else to draw the progress indicator.

Chris

BwB
03-30-2001, 06:14 AM
Ok:

Make a second thread that runs a second OpenGL context to display the progress bar. Your primary thread will compile the list and update the counter that is used by the secondary thread (progress thread).

Have fun!! http://www.opengl.org/discussion_boards/ubb/smile.gif

Gus
03-30-2001, 10:22 AM
Good suggestion..... I'll give it a go.

Gus.