How do I make a Loading Screen

Started by
9 comments, last by yablo_0 21 years, 1 month ago
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
Advertisement
I''m just a noobie but for a Loading Screen I would just use a Texture Mapped Quad if it wasn''t anything special, I don''t know about the Progress Bar

http://nehe.gamedev.net/

Hope that help''s
I''d use a loading screen.. i''d divide the load up into segments, and each segment i would update the screen and the progress bar a given amount
Disclaimer: "I am in no way qualified to present advice on any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)"
The textured quad is always good, and you can even fade it out with blending. Just stretch out a red quad for every thind you load, and write progress bar on top, and it will look enough like a progress bar.

-~-The Cow of Darkness-~-
-~-The Cow of Darkness-~-
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
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.
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
==Colt "MainRoach" McAnlisGraphics Engineer - http://mainroach.blogspot.com
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
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.
---K-1 Productions: Come visit us here.
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

This topic is closed to new replies.

Advertisement