Window management during startup

Lillpeter

New member
Joined
Sep 17, 2017
Messages
16
Hi everyone. I have small question about managing the app window at launch. I'm working on a startup sequence for my app, and have implemented a little splash screen (a small borderless window) created when OnCreate() is called. The splash is then reconfigured to look like a normal (decorated) window when everything is initialized.

The issue is: Right before my splash screen is created and displayed I can see a normal blank window popping up (using mojo default settings I presume) then it quickly morphs into my splash screen. Is there any way I can get rid of the first blank/popping window before I set it up in OnCreate()?

Regards Peter
 

Gerry Quinn

Active member
Tutorial Author
Joined
Jun 24, 2017
Messages
153
I don't use desktop much, but I did a little experiment. I found that when I use SetDeviceWindow() at the start of OnCreate(), it initially still opens up to the values I set with #GLFW_WINDOW_WIDTH and #GLFW_WINDOW_HEIGHT preprocessor directives. Presumably these have default values of 640 and 480 if you don't set them.

Setting the directive values to 10 and 10 is at least a semi-workaround. I don't know how low you can go with them, or whether you can make it completely invisible without hacking mojo.

Or you can set the directives to your preferred splash screen size. Then there will be no 'extra' window, but it will still be blank for a fraction of a second.
 

Lillpeter

New member
Joined
Sep 17, 2017
Messages
16
Interesting. Are you referring to the values defined in this file: targets\glfw3\template\config.csx? If I tweak them nothing seem to change though when I build my app? Do I need to process that file in some way before building my own application?
 

Lillpeter

New member
Joined
Sep 17, 2017
Messages
16
Awesome, now it works! Setting the default window to undecorated and the same size as my splash screen seems to have completly removed the unwanted effect.

Much appretiated! I still have alot to learn about these peripheral things ouside the scope of my own code.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,167
Glad you got ot working. Looking foreard to see your project.
 
Top Bottom