Hi Conan,

(I have the impression your name is a pseudonym, I wonder why... ;-)

[dumbquestion]

I am integrating some cuda into my osg app and one call requires the texture 
name/id.  How do I get that from my texture object?  I look through the source 
code and only found and id method in TextureObject, but my attempts to 
retrieive this bit of data eludes me.

[/dumbquestion]

Not a dumb question at all, part of learning how to use OSG is learning how the things fit together and what to do to get to the information you need...

From an osg::Texture* (Texture2D, etc.) you have access to the interface of osg::Texture (which Texture2D et al are subclasses of). But first, to get to your OpenGL texture ID for a given Texture2D, you need the context ID in which you want to get that information, which you can get for example from the GraphicsContext like so:

unsigned int contextID = gc->getState()->getContextID()

Then you can do:

GLuint textureID = texture->getTextureObject(contextID)->id();

to get the ID of the texture object in that context.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                    http://whitestar02.dyndns-web.com/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to