예제 #1
0
void RLightItem::draw(RGc & gc) const
{
    gc.addLight(&mLight);

    RItem::draw(gc);

    gc.removeLight(&mLight);
}
예제 #2
0
void RFrustumItem::draw(RGc & gc) const
{
    RFrustum of = gc.frustum();

    gc.setFrustum(mFrustum);

    RItem::draw(gc);

    gc.setFrustum(of);
}
예제 #3
0
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()));
    }
}
예제 #4
0
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);
}
예제 #5
0
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;
}