Updates without locking the surface

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Updates without locking the surface

snmvaughan
I've used several frameworks in the past which have a definite division between updates to the scene graph and rendering. The JOGL Animator doesn't offer any obvious mechanism to perform this task. Is everyone else performing all calculations and updates inside of their rendering pass?

It feels like update handling is missing from the API. I can image that the lifecycle for GLEventListener might look like:

  • init()
  • reshape()
  • update()
  • display()
  • repeat pairings of update() and display() until the window is reshaped or destroyed.
  • destroy()
Of course the other option is to perform the update() as part of the display() implementation, but that means that the update would be performed while the surface was locked. I would think that minimizing the surface lock time would be desirable.
Reply | Threaded
Open this post in threaded view
|

Re: Updates without locking the surface

gouessej
Administrator
Sorry for my silly question. Are you looking for something that works like SwingWorker but with JOGL?

Do you want to have a current OpenGL context when the update() method is called? If I see what you mean, you would like to have a callback that does not look any surface but that has a current OpenGL context, wouldn't you?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Updates without locking the surface

snmvaughan
I've worked with jMonkeyEngine and Ardor3D in the past, and both frameworks perform some activities that don't require any access to the surface.  As an example, maintaining the bounding boxes for a scene graph supports both picking and frustum culling.  Another example would be calculating world transformations for meshes within a scene graph.