Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-12 Thread Qingjie Zhang
Hi Robert, I fount it! I'm so sorry for my carelessness. Thank you s much!! Qingjie. robertosfield wrote: > Hi Qingjie, > > > This is no longer about the OSG, it's about C++.  Your mistake is straight > forward C++ issue of not matching the base classes parameters when overidding > a

Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-10 Thread Robert Osfield
Hi Qingjie, This is no longer about the OSG, it's about C++. Your mistake is straight forward C++ issue of not matching the base classes parameters when overidding a method: The Camera::DrawCallback base class is: /** Draw callback for custom operations.*/ struct OSG_EXPORT

Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-09 Thread Qingjie Zhang
Hi Robert, Do you mean the DrawCallback in the Camera class, which contains virtual void operator () (osg::RenderInfo& renderInfo) ? And here I can use the RenderInfo right? As I know, the following code can get a contextID: camera->getGraphicsContext()->getState()->getContextID(); Is this

Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-09 Thread Robert Osfield
Hi Qingjie, On 9 September 2015 at 09:27, Qingjie Zhang <305479...@qq.com> wrote: > Do you mean the DrawCallback in the Camera class, which contains > virtual void operator () (osg::RenderInfo& renderInfo) ? And here I can > use the RenderInfo right? > Yes. You can attach draw callbacks to

Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-09 Thread Robert Osfield
Hi Qingjie, The RenderInfo is managed by the my the rendering back end, it's passed to all draw callbacks and Drawables. Robert On 9 September 2015 at 04:29, Qingjie Zhang <305479...@qq.com> wrote: > Hi Robert, > I'm knowing that the RenderInfo->getContextID() can give me the contextID > to

Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-09 Thread Qingjie Zhang
Hi Robert, To get the handle of opengl texture, I attached a DrawCallback to the main camera, doing like these codes: struct MyCameraPostDrawCallback : public osg::Camera::DrawCallback { virtual void operator()(const osg::RenderInfo ) { int contextID =

[osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-08 Thread Qingjie Zhang
Hi, I generated a texture2d with osg, to use the texture in CUDA, I have to get the corresponding "opengl texture" handle(GLuint), and then access to the texture by the handle in CUDA. Now I don't know how to get the handle. Many thanks for your reply!!! ... Thank you! Cheers, Qingjie

Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-08 Thread Qingjie Zhang
Thank you Robert, well, I've checked the source code of OSG, and found what you said, but I still don't know about the contextID, what value of the parameter should I give to the function? Thanks so much! Qingjie. robertosfield wrote: > Hi Qingjie, > > > The osgTexture::TextureObject*

Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-08 Thread Qingjie Zhang
Hi Robert, I'm knowing that the RenderInfo->getContextID() can give me the contextID to use in the getTextureObject(uint contextID), but where can I get the RenderInfo? I searched the source code of Texture but did not find that.. Many thanks. Qingjie robertosfield wrote: > Hi Qingjie, > >

Re: [osg-users] how to get the handle of opengl texture that corresponds to a OSG::Texture

2015-09-08 Thread Robert Osfield
Hi Qingjie, The osgTexture::TextureObject* osg::Texture::getTextureObject(uint contextID) method can be used to get the OSG's wrapper for the OpenGL texture object. The TextureObject::id() method returns the OpenGL texture object id. Robert. On 8 September 2015 at 15:20, Qingjie Zhang