[osg-users] Graphics context issues

Ryan Thoryk ryan at thoryk.com
Mon Jul 9 00:00:14 PDT 2018


Hi,

I'm trying to query GL parameters such as GL_VENDOR, which require an active graphics context to work.  I looked another thread on this forum which explains how to do it, but it only works for a single-threaded viewer.  I'm running the viewer in multithreaded mode, and am getting crashes due to context issues.  Does anyone have an idea on how to do this?
Thanks

Example code.  Usually crashes at the makeCurrent() line:

Code:

//get renderer information
osgViewer::ViewerBase::Contexts contexts;
viewer->getContexts(contexts, true);
contexts[0]->makeCurrent();
std::string vendor = (const char*)glGetString(GL_VENDOR);
Report("Vendor: " + vendor);
contexts[0]->releaseContext();




Ryan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74276#74276







More information about the osg-users mailing list