Problem with GUI z-order after graphics restart

My jme application allows the user to alter the graphics settings from within the game. After saving the user changes into AppSettings, I use LegacyApplication.restart() to apply the changes. If the user has changed the Samples value for anti-alias, the Gui z-order is screwed up.
I traced the problem back to RenderContext.reset(). There are some differences between what is initially created during instance construction and what .reset() sets.

I am not very graphics savvy and cannot identify exactly the problem/cause. However, if I move all the instance value settings into a method, and call that same method in the base constructor and the .reset() method, the problem goes away.

Hopefully someone out there can apply a proper fix.

Probably connected with issue 380/801:
changing BitsPerPixel in AppSettings interferes with StatsAppState · Issue #801 · jMonkeyEngine/jmonkeyengine · GitHub

It makes me wonder if the geometry sorting is being reset and flipping it every time.

Does resetting it again switch it back?

1 Like

No, once it goes screwy it stays screwy - the only way to fix it is to restart
the application. I found the problem by realizing the difference between
original startup and a graphics restart was the different settings in
RenderContext.

It seems likely that RenderContext after .reset() should be identical to its
state after initial construction. I just wonder if the .reset() code drifted
out of sync with what is set by the instance member initialization.

1 Like