예제 #1
0
    //-----------------------------------------------------------------------
    void Camera::_renderScene(Viewport *vp, bool includeOverlays)
    {
        OgreProfileBeginGPUEvent("Camera: " + getName());

		//update the pixel display ratio
		if (mProjType == Ogre::PT_PERSPECTIVE)
		{
			mPixelDisplayRatio = (2 * Ogre::Math::Tan(mFOVy * 0.5f)) / vp->getActualHeight();
		}
		else
		{
			mPixelDisplayRatio = (mTop - mBottom) / vp->getActualHeight();
		}

		//notify prerender scene
		ListenerList listenersCopy = mListeners;
		for (ListenerList::iterator i = listenersCopy.begin(); i != listenersCopy.end(); ++i)
		{
			(*i)->cameraPreRenderScene(this);
		}

		//render scene
		mSceneMgr->_renderScene(this, vp, includeOverlays);

		// Listener list may have change
		listenersCopy = mListeners;

		//notify postrender scene
		for (ListenerList::iterator i = listenersCopy.begin(); i != listenersCopy.end(); ++i)
		{
			(*i)->cameraPostRenderScene(this);
		}
        OgreProfileEndGPUEvent("Camera: " + getName());
	}
예제 #2
0
    //-----------------------------------------------------------------------
    void RenderTarget::update(bool swap)
    {
        OgreProfileBeginGPUEvent("RenderTarget: " + getName());
        // call implementation
        updateImpl();


        if (swap)
        {
            // Swap buffers
            swapBuffers();
        }
        OgreProfileEndGPUEvent("RenderTarget: " + getName());
    }