husker-dev / openglfx

OpenGL node for JavaFX
Apache License 2.0
86 stars 12 forks source link

Suggestion: Add OpenGLCanvas#runLater(Runnable) #13

Closed orange451 closed 2 years ago

orange451 commented 2 years ago

JavaFX has a convenient way to defer a code execution until the next time JavaFX thread is unyielded using Platform#runLater(). I think an OpenGLCanvas#runLater(Runnable) method would be beneficial to defer code execution until the canvas will next render.

husker-dev commented 2 years ago

Why is this necessary? If this method exists, it will be executed at the moment of rendering. For this situations there are already methods onDraw or onUpdate.

orange451 commented 2 years ago

Like I said, as a means to defer rendering code from another thread. This way I can force synchronization with a specific node element.

You are right, that it isn't necessary, just convenient.

husker-dev commented 2 years ago

I don’t think this will be helpful, so I’ll close issue