VIEW_API void windowAttributes(size_t& handle, u32& width, u32& height)
{
	Ogre::Root* root = Ogre::Root::getSingletonPtr();
	
	if (! root)
		throw std::logic_error
			("View::windowAttributes: Ogre hasn't been initialized yet.");
	
	Ogre::RenderWindow* win = root->getAutoCreatedWindow();

	win->getCustomAttribute("WINDOW", &handle);
	height = win->getHeight();
	width = win->getWidth();
}
Beispiel #2
0
		OgreCameraWrapper::OgreCameraWrapper(const Glib::ustring& name) :
			CameraWrapper(name)
		{
			// Create the camera from the scenemanager
			// ---------------------------------------
			camera = GraphicModule::getInstancePtr()->getSceneManager()->createCamera(name);

			// Create one viewport, entire window
			// ----------------------------------
			Ogre::Root* ogreRoot       = Ogre::Root::getSingletonPtr();
			Ogre::RenderWindow* window = ogreRoot->getAutoCreatedWindow();
			Ogre::Viewport* vp         = window->addViewport(camera);
			vp->setBackgroundColour(Ogre::ColourValue(0.5,1,0));
		}