Archived

This topic is now archived and is closed to further replies.

yablo_0

How do I make a Loading Screen

Recommended Posts

I''m making an OpenGL game, and when it starts, it takes several seconds to load the data. How can i display a bitmap ( a loading screen) while my initalization functions are getting exectuted? Is there a tutorial on loading screens and progress bars using openGL somewhere? Thanks

Share this post


Link to post
Share on other sites
i''ve never actually done this but you could do somthing like this:


init(){
int orox,oroy,progress,totalprocesses;
glBegin(GL_LINES);
progress=0;
...load somthing...
glColor3f(0,0,1);
glVertex2f(orox,oroy);
glVertex2f(totalprocesses*10,oroy);
glColor3f(1,0,0);
glVertex2f(orox,oroy);
glVertex2f(progress*10,oroy);
progress=1;
...load somthing else...
glColor3f(0,0,1);
glVertex2f(orox,oroy);
glVertex2f(totalprocesses*10,oroy);
glColor3f(1,0,0);
glVertex2f(orox,oroy);
glVertex2f(progress*10,oroy);
...however many more times you need to
glEnd();
}

that would draw a single line progress bar. you might want to clear the screen before every drawing of the bar. -PmanC

Share this post


Link to post
Share on other sites
To make something interesting you can use any effect that can indicate progress - you could alpha in a 3d model that quickly loads or something. The basic idea is that you update the scene whenever you load something from disk. You may be wondering how you update the screen if you are loading from disk - remember that if you dont swap buffers, OGL wont change the scene. All you have to do is draw the next scene, load the data, and swap the buffers.

Share this post


Link to post
Share on other sites
I can''t remember where I saw it, but one of the coolest loading screens I had ever seen.
It pre-loaded a mini game , and set the timer to the amount of time it would take to load the next map. during that mini game, you could recieve bonuses etc.

Pretty interesting Idea if you ask me. I always hated the fact that "Loading.." ment "Get a sandwhich"

~Main

==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave

Share this post


Link to post
Share on other sites
quote:
Original post by duhroach
I can''t remember where I saw it, but one of the coolest loading screens I had ever seen.
It pre-loaded a mini game , and set the timer to the amount of time it would take to load the next map. during that mini game, you could recieve bonuses etc.

Pretty interesting Idea if you ask me. I always hated the fact that "Loading.." ment "Get a sandwhich"

~Main

==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave


!!!ORIGINAL TEKKIN!!!

don''t know if that''s how you spell it... -PmanC

Share this post


Link to post
Share on other sites
This isn''t just for "Loading..." screens either. Anywhere you need a progress bar, i.e. an RPG game like Final Fantasy 7, you can use this sort of quad-stretching. If you are using OpenGL w/ MFC you could even use the progress bar common control. The implementations and uses are almost limitless.

Share this post


Link to post
Share on other sites
actually, the actual drawing of the loading screen is not a problem, the problem is updating or drawing to the screen while executing some function which takes a conciderable amount of time executing before its done so basically

myInitFunction()
{
.... druing this time display a loading screen
}

function finished executing... loading screen not displayed

do you have to thread processes for that sort of thing?
or not Swapping the buffers would do as someone mentioned above?

thanks

Share this post


Link to post
Share on other sites