Loading screen

I’ve created an OpenGL application which loads various resources (model files, image files, map files).

All these resources are loaded in the init section of the application.

When I start the application it hangs while all the resources are loaded.

What I want to know is how do I display a loading output while everything is being loaded. It doesn’t need to be complex like status bars, just a screen outputting “loading” rather than a hanging terminal window.

Any suggestions, best ways to do this?


Sorry, this question is too advanced for me. Perhaps you better post in the highly advanced forum.

in windows:
1/ call CreateWindowEx and ensure WS_VISIBLE style is set for the ‘Loading’ window.
2/ call UpdateWindow( WindowHandle )
3/ load resources

advanced or not, i would recommend (under windows) to build your app with a console window and use print() function to display there anything you want.

print(“loading resources from directory”);

This is ugly. Why not create context, draw some nice OpenGL stuff and then load all the resources?

I would have the open window with an OpenGL context running on one thread, and load the resources on a separate one. That way, you can change some progress variable, and redraw the loading bar while loading the resources.

Is using threads complicated?

forget threads youre overcomplicating it, for what benifit?
I do this

create dummy opengl window / query stuff
load a plaintexture glsl shader
load a startup screen texture
draw this on a quad

current time since program startup is 300 msec (which feels instantaneous before the startscreen is showing, though u could do quicker if u wanted to no doubt)

… load all the other resources … textures/shaders/models etc

This may sound overly complicated, but if you trying to make a project or game that has to load a signifigant amount of resources and results in a 5+ secs of loading, then this is how it’s done.

What quality game presents a static quad for 20 seconds while it loads? It’s not hard to set up one threaded load function.