Hiding LWJGL startup.

Started by potatino, May 03, 2013, 15:25:57

Previous topic - Next topic

potatino

Hello,

My game is starting to be playable and I would like to put some nice finishing touches on it.

When the process starts, I initialize the Display, I load the graphic resources and set the window icon, and then I start the game loop.

LWJGL actually opens the windows as soon as I initialize the display, which means a blank window with the LWJGL icon is shown for 1-2 seconds before the game actually starts.

I'm thinking on including some type of loading screen or starting the game with the display hidden so when the window appears it is actually showing the logo and start menu. As far as I know, LWJGL does not support initializing a hidden display.

Has anyone solved this in some elegant way?

Thanks

spasi

You can call Display.setIcon before creating the Display. LWJGL caches the icon (required for recreating the window, e.g. when switching out of fullscreen mode), so that's no problem.

As for black content while loading the game, there's nothing stopping you from actually drawing a logo or even a loading animation as soon as possible. You don't even need a background thread, just interleave Display updates between your resource loading. It's only a matter of writing some rendering code "on the side" that doesn't depend on the rest of your engine being fully initialized. Which is basically the definition of splash screen functionality.

potatino

Thank you very much for your answer. My splash screen is performing fine now :)

I can't still believe that I mistyped "Hiding"... I just got a C2 Certificate in English! :P

quew8

The more qualifications you get, the less you have to bother with typing correctly. Part of the work to get a qualification is to figure out what the person before you actually wrote on the topic.