Can I call GL methods outside of GLJPanel callback?

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

Can I call GL methods outside of GLJPanel callback?

kitfox
I have an app where I've created a GLJPanel for rendering, passed it a GLEventListener object and use that object to render stuff to the screen.  While this works for most of my rendering, it is a pain to use with textures.  I'd like to be able to create and initialize textures outside of the GLEventListener callback.  I'd also like to be able to write render-to-texture code that also does not have to depend on GLJPanel getting around to calling GLEventListener.display().  However, I need to make sure that the GL objects I create share the same context so that my main rendering loop can use the textures that I'm manipulating outside of it.  Is there a way to do this?
Reply | Threaded
Open this post in threaded view
|

Re: Can I call GL methods outside of GLJPanel callback?

Sven Gothel
Administrator
On 09/02/2014 02:11 PM, kitfox [via jogamp] wrote:
> I have an app where I've created a GLJPanel for rendering, passed it a
> GLEventListener object and use that object to render stuff to the screen.
>  While this works for most of my rendering, it is a pain to use with textures.
>  I'd like to be able to create and initialize textures outside of the
> GLEventListener callback.  I'd also like to be able to write render-to-texture
> code that also does not have to depend on GLJPanel getting around to calling
> GLEventListener.display().  However, I need to make sure that the GL objects I
> create share the same context so that my main rendering loop can use the
> textures that I'm manipulating outside of it.  Is there a way to do this?

Shared Context:
  - http://forum.jogamp.org/Best-way-to-prepare-an-Image-
td4031731.html#a4031732
  - Also check our unit tests

Outside GL invocations:
  - Look at GLAutoDrawable.invoke(boolean wait, GLRunnable glRunnable)

~Sven



signature.asc (828 bytes) Download Attachment