Skip to content

Commit

Permalink
+ Assign the correct context id to the new render action so that corr…
Browse files Browse the repository at this point in the history
…ect VBOs are used
  • Loading branch information
ickby authored and wwmayer committed Jan 5, 2015
1 parent b2e32ab commit 7895134
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Gui/View3DInventorViewer.cpp
Expand Up @@ -422,7 +422,16 @@ void View3DInventorViewer::init()

// Set our own render action which show a bounding box if
// the SoFCSelection::BOX style is set
//
// Important note:
// When creating a new GL render action we have to copy over the cache context id
// because otherwise we may get strange rendering behaviour. For more details see
// http://forum.freecadweb.org/viewtopic.php?f=10&t=7486&start=120#p74398 and for
// the fix and some details what happens behind the scene have a look at this
// http://forum.freecadweb.org/viewtopic.php?f=10&t=7486&p=74777#p74736
uint32_t id = this->getSoRenderManager()->getGLRenderAction()->getCacheContext();
this->getSoRenderManager()->setGLRenderAction(new SoBoxSelectionRenderAction);
this->getSoRenderManager()->getGLRenderAction()->setCacheContext(id);

// set the transperency and antialiasing settings
// getGLRenderAction()->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);
Expand Down

0 comments on commit 7895134

Please sign in to comment.