void RLightItem::draw(RGc & gc) const { gc.addLight(&mLight); RItem::draw(gc); gc.removeLight(&mLight); }
void RFrustumItem::draw(RGc & gc) const { RFrustum of = gc.frustum(); gc.setFrustum(mFrustum); RItem::draw(gc); gc.setFrustum(of); }
void RParticleItem::draw(RGc & gc) const { if (!mParticles.isNull()) { if (mParticles->state() == RAnimation::None) { const_cast<RParticleItem *>(this)->mParticles->start(); } else if (mParticles->state() == RAnimation::Running) { const_cast<RParticleItem *>(this)->mParticles->step(); } gc.draw(*(mParticles.data())); } }
void RSpriteItem::draw(RGc & gc) const { if (mTexture.isNull()) { gc.draw(mShape); } else { RTexture tex = gc.texture(); gc.setTexture(mTexture); gc.draw(mShape); gc.setTexture(tex); } mProjection = gc.frustum(); mCamera = gc.camera(); mTransformation = gc.transformation(); RItem::draw(gc); }
void RGCSettings::draw(RGc & gc) const { if (mDepthTest == 1) { gc.enable(GL_DEPTH_TEST); } else if (mDepthTest == 0) { gc.disable(GL_DEPTH_TEST); } if (mBlending == 1) { gc.enable(GL_BLEND); } else if (mBlending == 0) { gc.disable(GL_BLEND); } if (mCulling == 1) { gc.enable(GL_CULL_FACE); } else if (mCulling == 0) { gc.disable(GL_CULL_FACE); } const_cast<RGCSettings *>(this)->mDepthTest = -1; const_cast<RGCSettings *>(this)->mCulling = -1; const_cast<RGCSettings *>(this)->mBlending = -1; }