Exemple #1
0
Viewport::~Viewport() {
    for (ListenerList::iterator i = mListeners.begin(); i != mListeners.end(); ++i) {
        (*i)->viewportDestroyed(this);
    }

    RenderSystem* rs = Root::get().getRenderSystem();
    if (rs && (rs->getViewport() == this)) {
        rs->setViewport(NULL);
    }
}
Exemple #2
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);
        }
    }
}
Exemple #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);
			}
		}
	}