• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ogre::RenderSystem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ogre::RenderSystem的典型用法代码示例。如果您正苦于以下问题:C++ RenderSystem类的具体用法?C++ RenderSystem怎么用?C++ RenderSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了RenderSystem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: init

/**
 * @brief init the object
 * @author kito berg-taylor
 */
void OgreWidget::init()
{
  // create the main ogre object
  mOgreRoot = new Ogre::Root;

  mOgreRoot->loadPlugin("RenderSystem_GL");
  Ogre::String rName("OpenGL Rendering Subsystem");
  Ogre::RenderSystemList rList = mOgreRoot->getAvailableRenderers();
  Ogre::RenderSystemList::iterator it = rList.begin();
  Ogre::RenderSystem *rSys = 0;
  while(it != rList.end())
  {
    rSys = * (it++);
    Ogre::String strx=rSys->getName();
    if(strx == rName)
    {
      mOgreRoot->setRenderSystem(rSys);
      break;
    }
  }
   QString dimensions = QString( "%1x%2" )
                    .arg(this->width())
                    .arg(this->height());
 
  rSys->setConfigOption( "Video Mode", dimensions.toStdString() );
 
  // initialize without creating window
  mOgreRoot->getRenderSystem()->setConfigOption( "Full Screen", "No" );
  mOgreRoot->saveConfig();
  mOgreRoot->initialise(false); // don't create a window
}
开发者ID:sartraher,项目名称:exodus,代码行数:35,代码来源:ogrewidget.cpp


示例2: float

	OgreRTTexture::OgreRTTexture(Ogre::TexturePtr _texture) :
		mViewport(nullptr),
		mSaveViewport(nullptr),
		mTexture(_texture)
	{
		mProjectMatrix = Ogre::Matrix4::IDENTITY;
		Ogre::Root* root = Ogre::Root::getSingletonPtr();
		if (root != nullptr)
		{
			Ogre::RenderSystem* system = root->getRenderSystem();
			if (system != nullptr)
			{
				size_t width = mTexture->getWidth();
				size_t height = mTexture->getHeight();

				mRenderTargetInfo.maximumDepth = system->getMaximumDepthInputValue();
				mRenderTargetInfo.hOffset = system->getHorizontalTexelOffset() / float(width);
				mRenderTargetInfo.vOffset = system->getVerticalTexelOffset() / float(height);
				mRenderTargetInfo.aspectCoef = float(height) / float(width);
				mRenderTargetInfo.pixScaleX = 1.0f / float(width);
				mRenderTargetInfo.pixScaleY = 1.0f / float(height);
			}

			if (mTexture->getBuffer()->getRenderTarget()->requiresTextureFlipping())
			{
				mProjectMatrix[1][0] = -mProjectMatrix[1][0];
				mProjectMatrix[1][1] = -mProjectMatrix[1][1];
				mProjectMatrix[1][2] = -mProjectMatrix[1][2];
				mProjectMatrix[1][3] = -mProjectMatrix[1][3];
			}
		}
	}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:32,代码来源:MyGUI_OgreRTTexture.cpp


示例3: createOgreRenderWindow

void wxOgre::createOgreRenderWindow()
{
	// Grab the current render system from Ogre
	Ogre::RenderSystem* renderSystem =
        Ogre::Root::getSingleton().getRenderSystem();

	// Create a new parameters list according to compiled OS
	Ogre::NameValuePairList params;
    getWindowParams(&params);

	// Get wx control window size
	int width;
	int height;
	GetClientSize(&width, &height);
	std::string name(GetName().mb_str(wxConvUTF8));

	// Create the render window (give the name of wxWidget window to Ogre)
	mRenderWindow =
        renderSystem->createRenderWindow(name, width, height, false, &params);

	// Set the viewport up with camera
	// NOTE: You can only create a camera after you have made the first camera
	//       we are going to need to be passed a camera for the second one
	if (mCamera)
	{
        mViewport = mRenderWindow->addViewport(mCamera);
        mViewport->setBackgroundColour(Ogre::ColourValue(1.0f, 0.0f, 0.0f,
                                                         1.0f));
	}
}
开发者ID:ChrisCarlsen,项目名称:tortuga,代码行数:30,代码来源:wxOgre.cpp


示例4: init

	void OgreWidget::init(std::string const& plugins_file, std::string const& ogre_cfg_file, std::string const& ogre_log)
	{
		// create the main ogre object
		_mOgreRoot = new Ogre::Root(plugins_file, ogre_cfg_file, ogre_log);

		// setup a renderer
		Ogre::RenderSystemList::const_iterator renderers = _mOgreRoot->getAvailableRenderers().begin();
		while(renderers != _mOgreRoot->getAvailableRenderers().end())
		{
			Ogre::String rName = (*renderers)->getName();
			if (rName == "OpenGL Rendering Subsystem")
				break;
			renderers++;
		}

		Ogre::RenderSystem *renderSystem = *renderers;

		_mOgreRoot->setRenderSystem(renderSystem);
		QString dimensions = QString("%1x%2")
											.arg(this->width())
											.arg(this->height());

		renderSystem->setConfigOption("Video Mode", dimensions.toStdString());

		// initialize without creating window
		_mOgreRoot->getRenderSystem()->setConfigOption("Full Screen", "No");
		_mOgreRoot->saveConfig();
		_mOgreRoot->initialise(false); // don't create a window
	}
开发者ID:JasonForrest,项目名称:Modules,代码行数:29,代码来源:qogrewidget.cpp


示例5: reconfigure

void ApplicationContext::reconfigure(const Ogre::String &renderer, Ogre::NameValuePairList &options)
{
    mNextRenderer = renderer;
    Ogre::RenderSystem* rs = mRoot->getRenderSystemByName(renderer);

    // set all given render system options
    for (Ogre::NameValuePairList::iterator it = options.begin(); it != options.end(); it++)
    {
        rs->setConfigOption(it->first, it->second);

#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
        // Change the viewport orientation on the fly if requested
        if(it->first == "Orientation")
        {
            if (it->second == "Landscape Left")
                mWindow->getViewport(0)->setOrientationMode(Ogre::OR_LANDSCAPELEFT, true);
            else if (it->second == "Landscape Right")
                mWindow->getViewport(0)->setOrientationMode(Ogre::OR_LANDSCAPERIGHT, true);
            else if (it->second == "Portrait")
                mWindow->getViewport(0)->setOrientationMode(Ogre::OR_PORTRAIT, true);
        }
#endif
    }

#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS
    // Need to save the config on iOS to make sure that changes are kept on disk
    mRoot->saveConfig();
#endif
    mRoot->queueEndRendering();   // break from render loop
}
开发者ID:wjwwood,项目名称:ogre,代码行数:30,代码来源:OgreApplicationContext.cpp


示例6: setRenderSystem

    void setRenderSystem(Ogre::RenderSystem* _render)
    {
        // отписываемся
        if (mRenderSystem != nullptr)
        {
            mRenderSystem->removeListener(this);
            mRenderSystem = nullptr;
        }

        mRenderSystem = _render;

        // подписываемся на рендер евент
        if (mRenderSystem != nullptr)
        {
            mRenderSystem->addListener(this);

            // формат цвета в вершинах
            Ogre::VertexElementType vertex_type = mRenderSystem->getColourVertexElementType();
            if (vertex_type == Ogre::VET_COLOUR_ARGB)
                mVertexFormat = VertexColourType::ColourARGB;
            else if (vertex_type == Ogre::VET_COLOUR_ABGR)
                mVertexFormat = VertexColourType::ColourABGR;

            updateRenderInfo();
        }
    }
开发者ID:jhooks1,项目名称:openmw,代码行数:26,代码来源:manager.cpp


示例7: FillHardwareBuffers

void CDynamicLineDrawer::FillHardwareBuffers()
{
	int Size = int(Points.size());

	PrepareHardwareBuffers(Size);

	if (!Size) {
		mBox.setExtents( Ogre::Vector3::ZERO, Ogre::Vector3::ZERO );
		Dirty = false;
		return;
	}

	Ogre::Vector3 AABMin = Points[0];
	Ogre::Vector3 AABMax = Points[0];

	Ogre::HardwareVertexBufferSharedPtr VBuf =
		mRenderOp.vertexData->vertexBufferBinding->getBuffer(0);

	Ogre::HardwareVertexBufferSharedPtr CBuf =
		mRenderOp.vertexData->vertexBufferBinding->getBuffer(1);

	// get rendersystem to pack colours
	Ogre::RenderSystem* RS = Ogre::Root::getSingleton().getRenderSystem();

	Ogre::Real* VPrPos = static_cast<Ogre::Real*>(VBuf->lock(Ogre::HardwareBuffer::HBL_DISCARD));
	Ogre::RGBA* CPrPos = static_cast<Ogre::RGBA*>(CBuf->lock(Ogre::HardwareBuffer::HBL_DISCARD));
	for(int i = 0; i < Size; i++)
	{
		*VPrPos++ = Points[i].x;
		*VPrPos++ = Points[i].y;
		*VPrPos++ = Points[i].z;

		Ogre::RGBA color;
		RS->convertColourValue(Colours[i], &color);
		*CPrPos++ = color;
		//*CPrPos++ = unsigned int(Colours[i].g);
		//*CPrPos++ = unsigned int(Colours[i].b);

		if(Points[i].x < AABMin.x)
			AABMin.x = Points[i].x;
		if(Points[i].y < AABMin.y)
			AABMin.y = Points[i].y;
		if(Points[i].z < AABMin.z)
			AABMin.z = Points[i].z;

		if(Points[i].x > AABMax.x)
			AABMax.x = Points[i].x;
		if(Points[i].y > AABMax.y)
			AABMax.y = Points[i].y;
		if(Points[i].z > AABMax.z)
			AABMax.z = Points[i].z;
	}
	VBuf->unlock();
	CBuf->unlock();

	mBox.setExtents(AABMin, AABMax);

	Dirty = false;
}
开发者ID:EdwardKL,项目名称:Astral,代码行数:59,代码来源:DynamicLineDrawer.cpp


示例8: debugRenderList

void OgreMinimalSetup::debugRenderList(const Ogre::RenderSystemList& rsl)
{
  assert(rsl.size() && "RenderSystemList size is 0");
  cout << "RenderSystemList size is " << rsl.size() << endl;
  Ogre::RenderSystem* rs = rsl[0];
  assert(rs && "First RenderSystem is NULL");
  cout << "First RenderSystem name is '" << rs->getName() << "'" << endl;
}
开发者ID:dreamsxin,项目名称:rainbrurpg,代码行数:8,代码来源:OgreMinimalSetup.cpp


示例9: registerHlms

	virtual void registerHlms(void)
	{
	GraphicsSystem::registerHlms();

	Ogre::ConfigFile cf;
	cf.load(mResourcePath + "resources2.cfg");

	Ogre::String dataFolder = cf.getSetting("DoNotUseAsResource", "Hlms", "");

	if (dataFolder.empty())
	dataFolder = "./";
	else if (*(dataFolder.end() - 1) != '/')
	dataFolder += "/";

	Ogre::RenderSystem *renderSystem = mpRoot->getRenderSystem();

	Ogre::String shaderSyntax = "GLSL";
	if (renderSystem->getName() == "Direct3D11 Rendering Subsystem")
	shaderSyntax = "HLSL";

	Ogre::Archive *archiveLibrary = Ogre::ArchiveManager::getSingletonPtr()->load(
	dataFolder + "Hlms/Common/" + shaderSyntax,
	"FileSystem", true);
	Ogre::Archive *archiveLibraryAny = Ogre::ArchiveManager::getSingletonPtr()->load(
	dataFolder + "Hlms/Common/Any",
	"FileSystem", true);
	Ogre::Archive *archivePbsLibraryAny = Ogre::ArchiveManager::getSingletonPtr()->load(
	dataFolder + "Hlms/Pbs/Any",
	"FileSystem", true);
	Ogre::Archive *pbsLibrary = Ogre::ArchiveManager::getSingletonPtr()->load(
	dataFolder + "Hlms/Pbs/" + shaderSyntax,
	"FileSystem", true);

	Ogre::ArchiveVec library;
	library.push_back(archiveLibrary);
	library.push_back(archiveLibraryAny);
	library.push_back(archivePbsLibraryAny);
	library.push_back(pbsLibrary);

	Ogre::Archive *archiveTerra = Ogre::ArchiveManager::getSingletonPtr()->load(
	dataFolder + "Hlms/Terra/" + shaderSyntax,
	"FileSystem", true);
	Ogre::HlmsTerra *hlmsTerra = OGRE_NEW Ogre::HlmsTerra(archiveTerra, &library);
	Ogre::HlmsManager *hlmsManager = mpRoot->getHlmsManager();
	hlmsManager->registerHlms(hlmsTerra);

	//Add Terra's piece files that customize the PBS implementation.
	//These pieces are coded so that they will be activated when
	//we set the HlmsPbsTerraShadows listener and there's an active Terra
	//(see Tutorial_TerrainGameState::createScene01)
	Ogre::Hlms *hlmsPbs = hlmsManager->getHlms(Ogre::HLMS_PBS);
	Ogre::Archive *archivePbs = hlmsPbs->getDataFolder();
	Ogre::ArchiveVec libraryPbs = hlmsPbs->getPiecesLibraryAsArchiveVec();
	libraryPbs.push_back(Ogre::ArchiveManager::getSingletonPtr()->load(
	dataFolder + "Hlms/Terra/" + shaderSyntax + "/PbsTerraShadows",
	"FileSystem", true));
	hlmsPbs->reloadFrom(archivePbs, &libraryPbs);
	}
开发者ID:fulletron,项目名称:BlockGame,代码行数:58,代码来源:main_OLD.cpp


示例10: clear

        void rtt::clear(unsigned buffers, const colour &c, float d, unsigned s)
        {
            assert(_viewport);

            Ogre::RenderSystem *rs = Ogre::Root::getSingleton().getRenderSystem();

            rs->_setViewport(_viewport);
            rs->clearFrameBuffer(buffers, c, d, s);
        }
开发者ID:Joooo,项目名称:pseudoform,代码行数:9,代码来源:rtt.cpp


示例11: fillHardwareBuffers

void FrameGraphRenderable::fillHardwareBuffers()
{
    Ogre::HardwareVertexBufferSharedPtr vbuf = mRenderOp.vertexData->vertexBufferBinding->getBuffer(0);
    Ogre::Real *vertices = static_cast<Ogre::Real*>(vbuf->lock(Ogre::HardwareBuffer::HBL_NORMAL));

    Ogre::HardwareVertexBufferSharedPtr vcbuf = mRenderOp.vertexData->vertexBufferBinding->getBuffer(1);
    Ogre::RGBA* pColours = static_cast<Ogre::RGBA*>(vcbuf->lock(Ogre::HardwareBuffer::HBL_NORMAL));

    Ogre::RenderSystem* rs = Ogre::Root::getSingleton().getRenderSystem();
    uint16_t index = 0;
    for (uint16_t i = 0; i < mNumFrames; i++) {
        float x = i * mLineSpace - 1.0f;

        // OgreTime line
        vertices[index +  0] = x;
        vertices[index +  1] = -1;
        vertices[index +  2] = 0;	// Vertex
        rs->convertColourValue(Ogre::ColourValue(1.0f, 0.0f, 0.0f), pColours++);		// Color
        vertices[index +  3] = x;
        vertices[index +  4] = -1;
        vertices[index +  5] = 0;	// Vertex
        rs->convertColourValue(Ogre::ColourValue(1.0f, 0.0f, 0.0f), pColours++);		// Color

        // BulletTime line
        vertices[index +  6] = x;
        vertices[index +  7] = -1;
        vertices[index +  8] = 0;	// Vertex
        rs->convertColourValue(Ogre::ColourValue(0.0f, 1.0f, 0.0f), pColours++);		// Color
        vertices[index +  9] = x;
        vertices[index + 10] = -1;
        vertices[index + 11] = 0;	// Vertex
        rs->convertColourValue(Ogre::ColourValue(0.0f, 1.0f, 0.0f), pColours++);		// Color

        // WorldTime line
        vertices[index + 12] = x;
        vertices[index + 13] = -1;
        vertices[index + 14] = 0;	// Vertex
        rs->convertColourValue(Ogre::ColourValue(0.0f, 0.0f, 1.0f), pColours++);		// Color
        vertices[index + 15] = x;
        vertices[index + 16] = -1;
        vertices[index + 17] = 0;	// Vertex
        rs->convertColourValue(Ogre::ColourValue(0.0f, 0.0f, 1.0f), pColours++);		// Color

        // UnknownTime line
        vertices[index + 18] = x;
        vertices[index + 19] = -1;
        vertices[index + 20] = 0;	// Vertex
        rs->convertColourValue(Ogre::ColourValue(1.0f, 1.0f, 1.0f), pColours++);		// Color
        vertices[index + 21] = x;
        vertices[index + 22] = -1;
        vertices[index + 23] = 0;	// Vertex
        rs->convertColourValue(Ogre::ColourValue(1.0f, 1.0f, 1.0f), pColours++);		// Color

        index += ValuesPerGraphLine;
    }
    vcbuf->unlock();
    vbuf->unlock();

    mBox.setInfinite();
}
开发者ID:1am3r,项目名称:cubicplanets,代码行数:60,代码来源:McsHudGui.cpp


示例12: end

	void OgreRTTexture::end()
	{
		Ogre::RenderSystem* system = Ogre::Root::getSingleton().getRenderSystem();
		system->_setViewport(mSaveViewport);
#if OGRE_VERSION >= MYGUI_DEFINE_VERSION(1, 7, 0) && OGRE_NO_VIEWPORT_ORIENTATIONMODE == 0
		Ogre::OrientationMode orient = mSaveViewport->getOrientationMode();
		system->_setProjectionMatrix(Ogre::Matrix4::IDENTITY * Ogre::Quaternion(Ogre::Degree(orient * 90.f), Ogre::Vector3::UNIT_Z));
#else
		system->_setProjectionMatrix(Ogre::Matrix4::IDENTITY);
#endif
	}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:11,代码来源:MyGUI_OgreRTTexture.cpp


示例13: updateRenderInfo

 void updateRenderInfo()
 {
     if (mRenderSystem != nullptr)
     {
         mInfo.maximumDepth = mRenderSystem->getMaximumDepthInputValue();
         mInfo.hOffset = mRenderSystem->getHorizontalTexelOffset() / float(mViewSize.width);
         mInfo.vOffset = mRenderSystem->getVerticalTexelOffset() / float(mViewSize.height);
         mInfo.aspectCoef = float(mViewSize.height) / float(mViewSize.width);
         mInfo.pixScaleX = 1.0f / float(mViewSize.width);
         mInfo.pixScaleY = 1.0f / float(mViewSize.height);
     }
 }
开发者ID:jhooks1,项目名称:openmw,代码行数:12,代码来源:manager.cpp


示例14:

/** The Ogre renderQueueStarted implementation
  *
  * The more used parameter is the queueGroupId. 90 is for the 
  * object to be highlighted, 91 is its outline.
  *
  * \param queueGroupId The queue group identifier (90 and 91 are treated)
  * \param invocation Unused Ogre provided parameter
  * \param repeatThisInvocation Unused Ogre provided parameter
  *
  */
void RainbruRPG::Core::HighlightQueueListener::
renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, 
		 bool& repeatThisInvocation)
{
  if (( queueGroupId == 90 ) || ( queueGroupId == 91 )){
    Ogre::RenderSystem * rendersys = Ogre::Root::getSingleton()
      .getRenderSystem();

    rendersys->setStencilCheckEnabled(false);
    rendersys->setStencilBufferParams();
  }
}
开发者ID:dreamsxin,项目名称:rainbrurpg,代码行数:22,代码来源:HighlightListener.cpp


示例15: CreateRenderer

void GameMain::CreateRenderer()
{

	m_pkRoot = new Ogre::Root();

	mD3D9Plugin = new Ogre::D3D9Plugin();
	m_pkRoot->installPlugin(mD3D9Plugin);
	mOctreePlugin = new Ogre::OctreePlugin();
	m_pkRoot->installPlugin(mOctreePlugin);
	mBSPPlugin = new BspSceneManagerPlugin();
	m_pkRoot->installPlugin(mBSPPlugin);
	mCgPlugin = new CgPlugin();
	m_pkRoot->installPlugin(mCgPlugin);
	mParticleFXPlugin = new ParticleFXPlugin();
	m_pkRoot->installPlugin(mParticleFXPlugin);

	//	Initialize window
	Ogre::RenderSystem *selectedRenderSystem = m_pkRoot->getRenderSystemByName("Direct3D9 Rendering Subsystem");
	m_pkRoot->setRenderSystem(selectedRenderSystem);
	selectedRenderSystem->setConfigOption("Full Screen", "No");
	selectedRenderSystem->setConfigOption("VSync","Yes");
	char value[128];
	sprintf(value, "%d x %d @ %d-bit colour", Chapter::ms_nWidth, Chapter::ms_nHeight, 32);
	selectedRenderSystem->setConfigOption("Video Mode", value);



	m_pkWindow = m_pkRoot->initialise(false, "Test Bullet");

	Ogre::NameValuePairList parms;
	parms["externalWindowHandle"] = Ogre::StringConverter::toString((long)m_hWnd);

	m_pkWindow = m_pkRoot->createRenderWindow("Test Bullet", Chapter::ms_nWidth, Chapter::ms_nHeight, !Chapter::ms_bWindowed, &parms);

	Chapter::ms_hWnd = m_hWnd;
	Chapter::m_pkRoot = m_pkRoot;
	Chapter::m_pkWindow = m_pkWindow;

	m_pkRoot->addFrameListener( this );

	m_pkWindow->setActive(true);
	m_pkWindow->update();


	//	Add media path
	Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);


	m_fCurrentTime =  GetTickCount();
}
开发者ID:oksangman,项目名称:Ant,代码行数:50,代码来源:GameMain.cpp


示例16: initStart

bool OgreApplication::initStart(void)
{

    mPluginsCfg = "../configs/plugins.cfg";
    mResourcesCfg = "../configs/resources.cfg";

    Ogre::LogManager * lm = new Ogre::LogManager();
    lm->createLog("OgreLogfile.log", true, false, false);

    // construct Ogre::Root
    mRoot = new Ogre::Root(mPluginsCfg, "", "");

    Ogre::ConfigFile cf;
    cf.load(mResourcesCfg);

    // Go through all sections & settings in the file
    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();

    Ogre::String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
        Ogre::ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
        }
    }

    Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../assets/", "FileSystem");

    Ogre::ResourceGroupManager::getSingleton().addResourceLocation("../assets/particles", "FileSystem");

    // Do not add this to the application
    Ogre::RenderSystem *rs = mRoot->getRenderSystemByName("OpenGL Rendering Subsystem");
    mRoot->setRenderSystem(rs);
    rs->setConfigOption("Full Screen", "No");
    rs->setConfigOption("Video Mode", "800 x 600 @ 32-bit colour");
    rs->setStencilCheckEnabled(true);

    mRoot->initialise(false);

    running = true;
    return true;
}
开发者ID:AlexeyBelezeko,项目名称:eqOgre,代码行数:49,代码来源:ogreapplication.cpp


示例17: init

void OgreWidget::init( std::string plugins_file,  std::string ogre_cfg_file, std::string ogre_log )
{
  mOgreRoot = new Ogre::Root( plugins_file, ogre_cfg_file, ogre_log );
  Ogre::RenderSystemList renderers = mOgreRoot->getAvailableRenderers();
  assert( !renderers.empty() );
  Ogre::RenderSystem *renderSystem = chooseRenderer(& renderers );
  assert( renderSystem );
  mOgreRoot->setRenderSystem( renderSystem );
  QString dimensions = QString( "%1x%2" ).arg(this->width()).arg(this->height());
  renderSystem->setConfigOption( "Video Mode", dimensions.toStdString() );
  mOgreRoot->getRenderSystem()->setConfigOption( "Full Screen", "No" );
  mOgreRoot->saveConfig();
  mOgreRoot->initialise(false);
  initResourses();
}
开发者ID:Smiter,项目名称:Ogre_editor,代码行数:15,代码来源:QtWidget.cpp


示例18: configure

//-------------------------------------------------------------------------------------
bool THIS::configure(void)
{

    cout << "<TRACE><LOG><SceneManager><configure> Start" << endl;
    // Show the configuration dialog and initialise the system
    // You can skip this and use root.restoreConfig() to load configuration
    // settings if you were sure there are valid ones saved in ogre.cfg
    //mRoot->showConfigDialog();
    //{
    // If returned true, user clicked OK so initialise
    // Here we choose to let the system create a default rendering window by passing 'true'
    //     mWindow = mRoot->initialise(true, "TutorialApplication Render Window");

    //return true;
    //}
    //else
    //{
    //    return false;
    //}

    // setup a renderer
    Ogre::RenderSystemList::const_iterator renderers = mRoot->getAvailableRenderers().begin();
    while(renderers != mRoot->getAvailableRenderers().end())
    {
        Ogre::String rName = (*renderers)->getName();
        if (rName == "OpenGL Rendering Subsystem")
            break;
        renderers++;
    }

    Ogre::RenderSystem *renderSystem = *renderers;

    mRoot->setRenderSystem( renderSystem );
    QString dimensions = QString( "%1x%2" )
            .arg(this->width())
            .arg(this->height());

    renderSystem->setConfigOption( "Video Mode", dimensions.toStdString() );

    // initialize without creating window
    mRoot->getRenderSystem()->setConfigOption( "Full Screen", "No" );
    mRoot->saveConfig();

    cout << "<TRACE><LOG><SceneManager><configure> initialize" << endl;
    mRoot->initialise(false); // don't create a window

}
开发者ID:jmecosta,项目名称:Navlaser3,代码行数:48,代码来源:scene_manager.cpp


示例19: update

    void GameSettings::update()
    {
        Root* root = Ogre::Root::getSingletonPtr();
        
		Ogre::RenderSystem* renderer = root->getRenderSystem();

#if OGRE_VERSION_MINOR == 7 || OGRE_VERSION_MINOR == 8
        const RenderSystemList& renderers = root->getAvailableRenderers();
#else 
        const RenderSystemList renderers = *root->getAvailableRenderers();
#endif        
        createElements(mVideoRenderer, renderers.size());

        for (unsigned int i = 0; i < renderers.size(); ++i)
        {
			Ogre::RenderSystem* cur = renderers[i];
            ListboxItem* item = mVideoRenderer->getListboxItemFromIndex(i);
            item->setText(cur->getName());
            if (cur == renderer)
            {
                mVideoRenderer->setItemSelectState(item, true);
            }
        }
        
        ConfigOptionMap config = renderer->getConfigOptions();
        
        setOption(config, "Full Screen", mVideoFullscreen);
        std::vector<RadioButton*> videoColorDepth;
        videoColorDepth.push_back(mVideoColorDepth32);
        videoColorDepth.push_back(mVideoColorDepth16);
        
        setOption(config, "Colour Depth", videoColorDepth);
        std::vector<RadioButton*> videoAntiAliasing;
        videoAntiAliasing.push_back(mVideoFsaa0);
        videoAntiAliasing.push_back(mVideoFsaa2);
        videoAntiAliasing.push_back(mVideoFsaa4);
        videoAntiAliasing.push_back(mVideoFsaa8);
        setOption(config, "FSAA", videoAntiAliasing);
        
		std::vector<RadioButton*> videoRttMode;
        videoRttMode.push_back(mVideoRttModeFBO);
        videoRttMode.push_back(mVideoRttModePBuffer);
        videoRttMode.push_back(mVideoRttModeCopy);
        setOption(config, "RTT Preferred Mode", videoRttMode);
        
        setOption(config, "Video Mode", mVideoResolution);
    }
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:47,代码来源:GameSettings.cpp


示例20:

/**
 * Setup application configuration options
 */
bool Robot::Application::configure()
{
	// Always load the GL render system
	this->mRoot->loadPlugin("./RenderSystem_GL");

	// Get the GL Render system and set it on the root
	Ogre::RenderSystem* RS = this->mRoot->getAvailableRenderers()[0];
	this->mRoot->setRenderSystem(RS);

	// Dont use full-screen
	RS->setConfigOption("Full Screen", "no");

	// Setup the root window
	this->mWindow = this->mRoot->initialise(true, "CG - Project 4");

	return true;
}
开发者ID:EvanPurkhiser,项目名称:CS-Graphics-Robot,代码行数:20,代码来源:Application.cpp



注:本文中的ogre::RenderSystem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ogre::RenderTarget类代码示例发布时间:2022-05-31
下一篇:
C++ ogre::RaySceneQuery类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap