[osg-users] Access to gl context

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Mon Nov 13 15:37:20 PST 2017


Hi guys,

here some snippet:

osgViewer::CompositeViewer::Windows wins;
viewer->getWindows(wins);

osgViewer::GraphicsHandleWin32 *hdl =
dynamic_cast<osgViewer::GraphicsHandleWin32*>(wins.at(0));
hdl->getWGLContext();

On Mon, Nov 13, 2017 at 1:45 PM, Christian Buchner <
christian.buchner at gmail.com> wrote:

>
> Is this the function you're looking for?
>
> osgViewer::GraphicsHandleWin32::getWGLContext
> <http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00355.html#abbf6db2b0a8d14f825dd43435862a941>()
>
>
> I am having some trouble (despite the powers of Google) to find any OSG
> example code using getWGLContext()
>
> Christian
>
>
> 2017-11-10 14:33 GMT+01:00 Poojan Prabhu <poojanpromin at gmail.com>:
>
>> Hi,
>>
>> We are using shared context, but have custom drawables that use Vertex
>> Array Objects. This causes a problem in the case of multiple windows (where
>> each is a separate gl context).
>>
>> We can manage/create vaos depending on the gl context id that we are
>> currently rendering with.
>>
>> But, we can't use context id as reported by render info, because that
>> represents the shared context id and not the HGLRC
>>
>> Prefer to avoid wglGetCurrentContext in each draw call obviously. And we
>> _do_ want to use shared contexts.
>>
>> How can we work around this so that we have access to the HGLRC or an id
>> representing it?
>>
>> Thank you!
>>
>> Cheers,
>> Poojan
>>
>> ------------------
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=72358#72358
>>
>>
>>
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20171114/98956a68/attachment.html>


More information about the osg-users mailing list