示例#1
0
	void init_render_sys()
	{
		m_root = new Ogre::Root();
		m_root->setRenderSystem(m_root->getRenderSystemByName("OpenGL Rendering Subsystem"));
		m_root->initialise(false);
		m_frm = new wxFrame(0,-1,wxT(""));
		NameValuePairList a;
		a.insert(std::pair<String,String>("externalWindowHandle",StringConverter::toString( (size_t) m_frm->GetHandle() )));
		RenderSystem *sys = m_root->getRenderSystem();
		RenderWindow *m_ren = sys->_createRenderWindow(String("OgreRenderWindow_00"),1,1,false,&a);
		MaterialManager::getSingleton().initialise();
		m_frm->Show(false);
	}
示例#2
0
void wxOgrePanel::createOgreRenderWindow()
{
	int width;
	int height;
	RenderSystem *sys = OgreInitializer::root()->getRenderSystem();
	NameValuePairList a;

	a.insert(std::pair<String,String>("externalWindowHandle",StringConverter::toString( (size_t) this->GetHandle() )));
	GetSize(&width, &height);
	m_unique_name = StringConverter::toString((size_t) GetId());
	m_RenderWindow = sys->_createRenderWindow(String("OgreRenderWindow")+m_unique_name,width,height,false,&a);
	m_Root = OgreInitializer::root();
	createSceneManager();
	createCamera();
	m_ViewPort = m_RenderWindow->addViewport(m_Camera); 
	m_ViewPort->setBackgroundColour(Ogre::ColourValue(1.0f, ((GetId()*23)&0xFF)/255.0f, 0.0f, 1.0f));
	update();
}