Replies: 3 comments 1 reply
-
Game Engines like Godot or Unity just restart the game from the very beginning and recreate resources from there. They don't do any reference tracking at all. You can emulate this by running any android game that uses Unity and send it to background. Open as many other apps as you can and that should trigger the EGL context from an Android surface to be destroyed. |
Beta Was this translation helpful? Give feedback.
-
One thing I've done in the past is use the MS Extensions DI container, that way you can just re-create the entire container and that in turn restarts the game. It's also quite a nice way to pass around the various handles |
Beta Was this translation helpful? Give feedback.
-
i just pass around a GL object, and if the context gets destroyed, oh well |
Beta Was this translation helpful? Give feedback.
-
Something has perplexed me for quite some time. In my projects, I typically have a reference to the GL object which gets passed around to everything that requires OpenGL.
Some things I've noticed about Silk.NET GL Object:
OpenGLManager.Instance.OpenGL.Clear(...)
(...Instance.OpenGL ends up becoming a variable in a lot of functions, too) or lack of a singleton and just have static state, which could be yikes to implement for context loss reasons.some state
into the class. But because you can have only one base class, this removes a layer of abstraction from your control (which should be fine for 99% of cases?)So, let's talk. What methods have you guys been successful with?
Beta Was this translation helpful? Give feedback.
All reactions