2009/4/26 Emmanuele Bassi <[email protected]>

> On Thu, 2009-04-23 at 19:55 +0200, Julien Isorce wrote:
>
> >
> > Actually I want to update a ClutterTexture with a texture that comes
> > from my own opengl context that is created in an other thread than the
> > clutter one.
>
> uh-oh. potential exponential mess alert.
>
> > Just after creating my opengl context, I call wglSharelists or I call
> > myopenglcontext = GLXCreateContext (....,  clutter_gl_context..)
> > And this call is ok. (it does not fail).
>
> it would be problematic if it did fail.


It fails in some conditions. For example, the  clutter_gl_context must not
be current somewhere.


> but how on earth are you getting the GLX context created by Clutter,
> since we don't expose any API to do that (and for good reasons)?


glxGetCurrentContext with glx, and wglGetCurrentContext with wgl.
(eglGetCurrentContext with GL ES 2.0)

I am ok with the fact I am not using clutter in a normal way (recomended).
*
*

>
> have you read the documentation for GLXCreateContext(), specifically
> what it says about direct rendering contexts sharing the same address
> space and sharelists?


Same process. This is my case.


>
>
> why are you creating a new GL context in the first place?


I am using other opengl framework too.

>
>
> > A point I saw is that in clutter_texture_set_cogl_texture a
> > queue_redraw is done. So how can I be sure that the cogl texture is
> > drawn ? I mean when can I delete my texture that comes from my opengl
> > context ?
>
> redraws are queued in the same thread that called clutter_main(); you
> should be destroying your GL texture when you are changing the
> CoglHandle to the ClutterTexture with another one OR when you are
> destroying the ClutterTexture. otherwise, it's not safe at all.


Ok I am destroying the previous gl texture when I change the CoglHandle.
Now I am sure I can do that.


>
>
> > Does someone already tried a such case ? Any idea about the best way
> > to update a clutter texture with a foreign opengl texture ?
> > Frame buffer object is used inside the clutter texture ? (I can see
> > some offscreen word in clutter texture source code)
>
> FBOs are used (and enter the picture) only when creating a Texture
> containing an actor.


ok

I am making a concrete example. It does not work properly yet but I have
some results and so I think I am not so far from a final solution
I will share it when ready, if I can finalize it. (because I am not sure
it's definitively possible)


>
> ciao,
>  Emmanuele.
>
> --
>

Sincerely

Julien

Reply via email to