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

Robert Osfield robert.osfield at gmail.com
Wed Sep 9 01:43:15 PDT 2015


Hi Qingjie,

On 9 September 2015 at 09:27, Qingjie Zhang <305479421 at 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 Drawables, StateAtttribute and
Camera's.



>
> As I know, the following code can get a contextID:
> camera->getGraphicsContext()->getState()->getContextID();
> Is this contextID same as the upper one?
>

If you only need the contexID then getting it from the graphics context is
perfectly fine.  What route to take depends on when you need to do your
queries.

I would add that the TextureObject for each context is only created by the
draw thread for each context, so the TextureObject won't exist right away
when you create your osg::Texture and assign them to the scene graph.

Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150909/bd138063/attachment-0003.htm>


More information about the osg-users mailing list