Login  Register

Re: RFC: GLAutoDrawable API Change regarding control of GLEventListener

Posted by Sven Gothel on Nov 04, 2012; 8:03pm
URL: https://forum.jogamp.org/RFC-GLAutoDrawable-API-Change-regarding-control-of-GLEventListener-tp4026760p4026765.html

On 11/04/2012 08:42 PM, gouessej [via jogamp] wrote:
> I don't understand the last change, invoke() already has a parameter to
> indicate whether or not the runnable has to be executed now or later.
> Personally, I find the enqueue() method useless and confusing.

I agree.

However invoke(..) does provoke display() even if wait==false
in case no animator is running.

'invoke()' will only return early if wait==false _and_ an animator is running,
in all other cases it either waits for the result or triggers display() itself.

'invoke' shall make clear that the GLRunnable will be invoked w/o further action 'soon'.
'enqueue' may not invoke the GLRunnable w/o further interaction,
but if an animator is running and attached.

Alternatively, instead of enqueue(..), we could add a method:
  + boolean invoke(boolean wait, List<GLRunnable> glRunnables)

this way batching GLRunnables can be left to the user
while not introducing new semantics.

Pro:
Such method would also offer a better determination of the GLRunnable
queue-in time, i.e. not processed by an animator while adding to the queue.
Using 'enqueue(GLEventListener)' would require to pause the animator
to ensure non got executed while feeding the queue.

Con:
This would require to create a temporary List object and perform more
operations.

What do you think ? Everybody ?


~Sven



signature.asc (907 bytes) Download Attachment