Hello Constantin,

Constantin Müller wrote:
> 2009/10/28 Carsten Neumann
>     ok, here I'm afraid you lost me a little. Are you describing here how
>     you create the texture you want to change on the GPU in the first place?
>       My explanation above was about what to do if you have the GL id of a
>     texture (one that is created outside of OpenSG) and want to render some
>     OpenSG geometry with it.
>     If you want to use a texture in multiple places you can add the same
>     TextureObjChunk to multiple materials.
> 
> 
> The first part of the question was how I could include an existing 
> GLObject into OpenSG.
> This part was sort of the other way around.
> Here the idea was to create an OpenSG Object and Texture and modify the 
> texture by getting the GLID of OpenSG and use this with OpenGL.

ah, in that case I think I did not answer the second half. 
TextureObjChunk has a GLId field. However, this is not directly an 
OpenGL id, to get that you use the value of the GLId field and look up 
the real OpenGL id in the OpenGL context you are interested in, like this:

UInt32 texId       = texObj->getGLId();
UInt32 texOpenGLId = window->getGLObjectId(texId);

where window is a pointer to the window you are using (a window in 
OpenSG essentially represents an OpenGL context).

        Cheers,
                Carsten

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to