コード例 #1
0
ファイル: Billboard.cpp プロジェクト: g2p/magnum-examples
void Billboard::draw(const Matrix3& transformationMatrix, SceneGraph::AbstractCamera2D& camera) {
    shader.setTransformationProjectionMatrix(camera.projectionMatrix()*transformationMatrix)
        .setTexture(texture)
        .setColorCorrectionTexture(colorCorrectionTexture);

    mesh.draw(shader);
}
コード例 #2
0
void Sprite::draw(const Matrix3& transformationMatrix, SceneGraph::AbstractCamera2D& camera) {
    if(!_texture) return;

    _shader->setTransformationProjectionMatrix(camera.projectionMatrix()*transformationMatrix*Matrix3::scaling(Vector2(_size)))
        .use();
    _texture->bind(Shaders::Flat2D::TextureLayer);
    _mesh->draw();
}
コード例 #3
0
void TextSprite::draw(const Matrix3& transformationMatrix, SceneGraph::AbstractCamera2D& camera) {
    _shader->setBackgroundColor(_backgroundColor)
        .setColor(_color)
        .setTransformationProjectionMatrix(camera.projectionMatrix()*transformationMatrix)
        .use();
    _glyphCache->texture().bind(Shaders::Vector2D::VectorTextureLayer);
    _mesh.draw();
}
コード例 #4
0
void AbstractHudText::draw(const Matrix3& transformationMatrix, SceneGraph::AbstractCamera2D& camera) {
    shader->setTransformationProjectionMatrix(camera.projectionMatrix()*transformationMatrix)
        .setColor(Color3(1.0f))
        .setOutlineRange(0.5f, 1.0f)
        .setVectorTexture(glyphCache->texture());

    text->mesh().draw(*shader);
}