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); } }
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); } } }
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); } } }