Advertisement Jump to content
Sign in to follow this  
Konamis

OpenGL Loading, please wait!

This topic is 4984 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! I'm about this sentence. How to make this picture, when game data loading? Is somewhere source code about this in C++ OpenGL?

Share this post


Link to post
Share on other sites
Advertisement
Make a game state check... for instance:



Pseudo code:

switch(GameState)
{
case Menu:
//draw menu stuff
break;
case Loading:
//draw stuff
break;
case PlayLevel:
//drawStuff
break;
}




you get the point, right? :) this should also be done with Update(), so that you dont update objects while in the menu etc..

Hope it helps!

Share this post


Link to post
Share on other sites
Or use classes with virtual functions that control the different states of your app/game, switching between the states in the update function (and deleting the old states if they aren't needed anymore). It's harder to implement, but doesn't chew up processing power while sorting through the switch statement (although if you don't have many states, a switch statement should be fine).

Share this post


Link to post
Share on other sites
Are you looking for a graphical status bar?

Those are typically done through two images:
1) An image of the status bar empty.
2) An image of the status bar 100% complete.

The key is to draw only parts of the second image depending on how many of your resources are loaded.

Share this post


Link to post
Share on other sites
Hi,
The idea is simple let's say you have these files
video.avi (5MB) , sound.mp3(1MB) ,texture.bmp {1MB)
see this pseudo code:

SizeofTheFiles=7;//count it by your self
Video_AVI_Percent=5/SizeofTheFiles;//this is float number
Sound_Mp3_Percent=1/SizeofTheFiles;
Texture_Bmp_Percent=1/SizeofTheFiles;

Scale_=0;//for scaling the loading bar

Video_=false;//to check if we load it or not
Sound_=false;


while(Loop_of_The_Game){
DrawTheBar();
glScalef(Scale_,1,1);
if(!Video_){
LoadVideo("video.avi");
Scale_+=Video_AVI_Percent;
Video_=!Video_;
}elseif(!Sound_){
LoadSound("sound.mp3");
Scale_+=Video_Mp3_Percent;
Sound_=!Sound_;
}else{
LoadTexture("texture.bmp");
Scale_+=Video_Bmp_Percent;
}
SendTheBuffer();
}


I hope this is what you want.
bye

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!