Changes

Jump to navigation Jump to search
117 bytes added ,  14:30, 31 January 2020
m
→‎Proof of concept (patch): https://github.com/MegaMotion/FlightGear/commit/6a589d0b172fc708fd9812ebb3aeb268186865d0
Line 157: Line 157:     
== Proof of concept (patch) ==
 
== Proof of concept (patch) ==
{{Note|This will not actually disable rendering, but merely hide the window by rendering to a pbuffer (FBO)}}
+
{{Note|This will not actually disable rendering, but merely hide the window by rendering to a pbuffer (FBO). For the git repo, see [https://github.com/MegaMotion/FlightGear/commit/6a589d0b172fc708fd9812ebb3aeb268186865d0]}}
 +
 
 +
 
 +
 
 
The main camera is created in CameraGroup::buildCamera and a pbuffer is allocated when you set osg::GraphicContext::Traits.pbuffer to true. These traits are available in buildCamera because we set width and height there. For debugging purpose, you can add a line like
 
The main camera is created in CameraGroup::buildCamera and a pbuffer is allocated when you set osg::GraphicContext::Traits.pbuffer to true. These traits are available in buildCamera because we set width and height there. For debugging purpose, you can add a line like
 
<syntaxhighlight lang="cpp">window->gc->getTraits()->pbuffer=true;
 
<syntaxhighlight lang="cpp">window->gc->getTraits()->pbuffer=true;

Navigation menu