Beispiel #1
0
        public RenderFontCommand(Font f, Vector3 position, String s, Color4 color, bool is3d = true)
            : base()
        {
            myFont     = f;
            myString   = s;
            myPosition = position;
            renderState.setUniform(new UniformData(21, Uniform.UniformType.Color4, color));
            pipelineState.blending.enabled  = true;
            pipelineState.depthTest.enabled = false;

            myFont.setupRenderCommand(this);
            myFont.updateText(myString, myVbo, myIbo);
            renderState.setVertexBuffer(myVbo.id, 0, 0, V3T2.stride);
            renderState.setIndexBuffer(myIbo.id);

            Matrix4 model = Matrix4.CreateTranslation(myPosition);

            //add the model view projection matrix
            renderState.setUniform(new UniformData(0, Uniform.UniformType.Mat4, model));
            renderState.setUniform(new UniformData(1, Uniform.UniformType.Bool, is3d));
        }
Beispiel #2
0
 public override void execute()
 {
     myFont.updateText(myString);
     base.execute();
     myFont.drawText();
 }