Esempio n. 1
0
void Viewport::clear(u32 buffers/* = FBT_COLOUR | FBT_DEPTH*/, const Color& color/* = Color::Black*/, f32 depth/* = 1.f*/, u16 stencil/*  = 0*/) {
    RenderSystem* rs = Root::get().getRenderSystem();
    if (rs) {
        Viewport* currentvp = rs->getViewport();
        if (currentvp && currentvp == this) {
            rs->clearFrameBuffer(buffers, color, depth, stencil);
        } else if (currentvp) {
            rs->setViewport(this);
            rs->clearFrameBuffer(buffers, color, depth, stencil);
            rs->setViewport(currentvp);
        }
    }
}
Esempio n. 2
0
    //---------------------------------------------------------------------
	void Viewport::clear(unsigned int buffers, const ColourValue& col,  
						 Real depth, unsigned short stencil)
	{
		RenderSystem* rs = Root::getSingleton().getRenderSystem();
		if (rs)
		{
			Viewport* currentvp = rs->_getViewport();
			if (currentvp && currentvp == this)
				rs->clearFrameBuffer(buffers, col, depth, stencil);
			else if (currentvp)
			{
				rs->_setViewport(this);
				rs->clearFrameBuffer(buffers, col, depth, stencil);
				rs->_setViewport(currentvp);
			}
		}
	}
Esempio n. 3
0
	void Viewport::clear(uint32_t buffers /* = FBT_COLOUR | FBT_DEPTH */, const ColourValue& colour /* = ColourValue::Black */, float depth /* = 1.0f */, uint16_t stencil /* = 0 */)
	{
		RenderSystem* rs = Engine::getSingleton().getRenderSystem();
		if (rs)
		{
			Viewport* currentvp = rs->getViewport();
			if (currentvp && currentvp == this)
			{
				rs->clearFrameBuffer(buffers, colour, depth, stencil);
			}
			else
			{
				rs->setViewport(this);
				rs->clearFrameBuffer(buffers, colour, depth, stencil);
				rs->setViewport(currentvp);
			}
		}
	}
Esempio n. 4
0
    void renderQueueStarted(uint8 queueGroupId, const Ogre::String& invocation,
                            bool& skipThisInvocation)
    {
        using namespace Ogre;

        if (queueGroupId == RENDER_QUEUE_6)
        {
            RenderSystem* rs = Root::getSingleton().getRenderSystem();
            rs->clearFrameBuffer(FBT_STENCIL);
            rs->setStencilCheckEnabled(true);
            rs->setStencilBufferParams(
                CMPF_ALWAYS_PASS,
                0xFFFFFFFF, 0xFFFFFFFF,
                SOP_KEEP,
                SOP_INCREMENT,
                SOP_REPLACE,
                false);
        }
    }