20,741
edits
m (→Related: Switched to the {{flightgear commit}} template for the SF link.) |
|||
Line 135: | Line 135: | ||
== 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}} | {{Note|This will not actually disable rendering, but merely hide the window by rendering to a pbuffer (FBO)}} | ||
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; |