コード例 #1
0
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();
}
コード例 #2
0
ファイル: ogrecamerawrapper.cpp プロジェクト: leirbag/Gnoll
		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));
		}