SHARE
TWEET

Untitled

Boost Feb 4th, 2015 255 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Ogre::CompositorManager2* manager = Graphics::Get()->GetOgreRoot()->getCompositorManager2();
  2.  
  3.     auto templatedworkspace = manager->addWorkspaceDefinition("GraphicalInputEntity_clear_workspace");
  4.  
  5.     // Create a node for rendering on top of everything
  6.     auto rendernode = manager->addNodeDefinition("GraphicalInputEntity_clear_node");
  7.  
  8.     rendernode->setNumTargetPass(1);
  9.  
  10.     // Pass for it
  11.     Ogre::CompositorTargetDef* targetpasses =
  12.         rendernode->addTargetPass("renderwindow");
  13.     targetpasses->setNumPasses(1);
  14.  
  15.     Ogre::CompositorPassClearDef* clearpass =
  16.         static_cast<Ogre::CompositorPassClearDef*>(targetpasses->
  17.             addPass(Ogre::PASS_CLEAR));
  18.  
  19.     // Clear all of the buffers
  20.     clearpass->mClearBufferFlags = Ogre::FBT_DEPTH | Ogre::FBT_STENCIL | Ogre::FBT_COLOUR;
  21.  
  22.     // Connect the main render target to the node
  23.     templatedworkspace->connectOutput("GraphicalInputEntity_clear_node", 0);
  24.  
  25.     // create scene manager //
  26.     AutoClearResources->WorldsScene = ogre->createSceneManager(Ogre::ST_GENERIC, 1,
  27.         Ogre::INSTANCING_CULLING_SINGLETHREAD, "GraphicalInputEntity_clear_scene_"+Convert::ToString(WindowNumber));
  28.  
  29.         // create camera //
  30.         AutoClearResources->WorldSceneCamera = AutoClearResources->WorldsScene->createCamera("Cam");
  31.  
  32.         // Create the workspace for this scene //
  33.         // Which will be rendered before the overlay workspace //
  34.         AutoClearResources->WorldWorkspace = ogre->getCompositorManager2()->addWorkspace(AutoClearResources->WorldsScene,
  35.         DisplayWindow->GetOgreWindow(), AutoClearResources->WorldSceneCamera, "WorldsWorkspace", true, 0);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top