Loobinex / keeperfx-unofficial

KeeperFX - Unofficial release
60 stars 7 forks source link

Destroy less windows #198

Closed eddebaby closed 4 years ago

eddebaby commented 4 years ago

The current window (lbWindow) was being destroyed/recreated whenever LbScreenSetup/LbScreenReset were called.

This is "ugly", so if there is no change in resolution, then the window is no longer destroyed, and splash->intro->menu->in-game transitions are instant. Changes in screen size/mode will still be "ugly", but might be slightly "cleaner".

Now, a new window is only created when there is no current window.

And, before that check, the current window is only destroyed, if the "new window" is different from the "previous window".

A change in resolution, or a change between fullscreen and windowed mode, will trigger the destruction of the old window, and the creation of a new one.