I thought it’d be fun to add a loading screen to my OpenGL game (as a lot of computations are done before the program is loaded, and waiting ~30secs with no reaction at all is pretty dull.)
I’ve worked out that the simplest way to do it would be to:
- create a thread, where all initialization data is handled
- in the main thread, in te display function, check, whether the initialization has finished, and if not, display something (eg. some text.) If it has finished - the game is loaded and the standard screen can be shown.
However, the problem is that the initialization stuff handled in the newly created thread uses glCreateList, glNewList, drawing onto that list, etc. As I figured out after reviewing some threads in the forum, my newly created thread doesn’t have the OpenGL context, also that I shouldn’t even attempt to share the same context over several threads.
Has anyone have the idea how to make this work? Or perhaps, the better way to create graphical loading screen? Thanks in advance!