Re: JOGL Questions - Guidance on creating Scene class
Posted by
gouessej on
Oct 30, 2015; 8:49am
URL: https://forum.jogamp.org/JOGL-Questions-Guidance-on-creating-Scene-class-tp4035659p4035674.html
Each state can still have its own separate input handler, root node, ... I don't use any entity component system as it is overkill in my case. When you move from one state to another one, you can clean your mess and install the state-specific objects. I would rather separate the concerns by putting the different sets of controls into different classes if I were you.
Yes, it's better because if you pass a GL object to a method, it's not obvious that the receiver is executed on a thread on which the OpenGL context is current and you're not sure that the GL instance is still valid. If you follow my advise, in the worst case you'll get a clear GL exception telling you that there is no current OpenGL context on this thread.
You can still use different root nodes and different rendering methods for your states.