Discussion:
Getting the opengl texture id of an osg::Texture2D
Steffen Kim
2008-07-23 14:58:25 UTC
Permalink
Hi,

I cannot find the correct function to get the OpenGL texture-id of an osg::Texture2D.

I have several textures in OSG that I want to use as input for a library that needs the textures as GLuint.

How do I get my OSG-textures in there?

And how can I create an osg::Texture2D out of the GLuint I get as a result after running the API?


I would be really happy about any hints on how to do this.
Thanks in advance,
Steffen
_______________________________________________________________________
EINE FÜR ALLE: die kostenlose WEB.DE-Plattform für Freunde und Deine
Homepage mit eigenem Namen. Jetzt starten! http://unddu.de/?kid=***@mf2
Alberto Luaces
2008-07-23 15:16:51 UTC
Permalink
Hi,

you can use osg::Texture::getTextureObject and then
osg::Texture::TextureObject._id

Alberto
Post by Steffen Kim
Hi,
I cannot find the correct function to get the OpenGL texture-id of an osg::Texture2D.
I have several textures in OSG that I want to use as input for a library
that needs the textures as GLuint.
How do I get my OSG-textures in there?
And how can I create an osg::Texture2D out of the GLuint I get as a result
after running the API?
I would be really happy about any hints on how to do this.
Thanks in advance,
Steffen
_______________________________________________________________________
EINE FÜR ALLE: die kostenlose WEB.DE-Plattform für Freunde und Deine
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Steffen Kim
2008-07-25 12:58:28 UTC
Permalink
Thanks for the help,

everything seems to work fine so far.

But now I'm a little bit lost on what the best way for creating an osg::Texture2D out of the ID of an OpenGL-texture is.

I have the id of an OpenGL-texture as the result delivered by the API I'm using and I want to get this texture as an osg::Texture2D.

I tried creating a new Texture2D, generating a TextureObject by using generateTextureObject and finally setting the _id of this TextureObject to the id of my result texture.
But I keep getting errors that way because the generated TextureObject seems to be invalid.

Do I have to add another step before setting the id? Or am I completely off and have to do it in a different way?

How do I get an osg::Texture2D from my OpenGL-Texture-ID?


Regards,
Steffen
_________________________________________________________________________
In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten!
Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114

Loading...