Re: Handling window events when using a dedicated OpenGL thread
Posted by
gouessej on
Oct 13, 2017; 9:10am
URL: https://forum.jogamp.org/Handling-window-events-when-using-a-dedicated-OpenGL-thread-tp4038251p4038255.html
You're welcome. There is no silly question, don't hesitate to ask anything about NEWT.
You can use an animator (preferably Animator instead of FPSAnimator) so that GLAutoDrawable.display() will be called, leave the auto swap buffer mode unchanged (enabled by default) and call GLAutoDrawable.invoke(boolean, GLRunnable) from your producer threads when they need to modify something requiring a current OpenGL context (for example to update a VBO). However, you seem to wish a tight control on the update, don't call GLAutoDrawable.display() in GLAutoDrawable.invoke(boolean, GLRunnable), just call GLAutoDrawable.display(), it should be enough but then you don't need an animator. The solution B is close to what seems to fit into your need.
P.S: Use an engine if you don't really want to drive things more complicated than they need to be, that's why they exist.