//----------------------------------------------------------------// void MOAIGfxDevice::BeginDrawing () { if ( this->mClearFlags & GL_COLOR_BUFFER_BIT ) { USColorVec clearColor; if ( this->mClearColorNode ) { clearColor = this->mClearColorNode->GetColorTrait (); } else { clearColor.SetRGBA ( this->mClearColor ); } glClearColor ( clearColor.mR, clearColor.mG, clearColor.mB, clearColor.mA ); } if ( this->mClearFlags ) { glClear ( this->mClearFlags ); } }
//----------------------------------------------------------------// void MOAISim::Render () { if ( this->mClearFlags & GL_COLOR_BUFFER_BIT ) { USColorVec clearColor; clearColor.SetRGBA ( this->mClearColor ); glClearColor ( clearColor.mR, clearColor.mG, clearColor.mB, clearColor.mA ); } if ( this->mClearFlags ) { glClear ( this->mClearFlags ); } USDrawBuffer::Get ().Reset (); RenderPassIt passIt = this->mRenderPasses.Head (); for ( ; passIt; passIt = passIt->Next ()) { MOAIProp2D* renderPass = passIt->Data (); USCanvas::BeginDrawing (); renderPass->Draw (); } USDrawBuffer::Get ().Flush (); }
//----------------------------------------------------------------// void MOAIGfxDevice::ClearColorBuffer ( u32 color ) { USColorVec colorVec; colorVec.SetRGBA ( color ); glClearColor ( colorVec.mR, colorVec.mG, colorVec.mB, 1.0f ); glClear ( GL_COLOR_BUFFER_BIT ); }