Esempio n. 1
0
        public void Update()
        {
            if (sprite == null)
            {
                return;
            }

            if (Id >= 0)
            {
                vUVScale = new vec2d_f(1.0f / sprite.Width, 1.0f / sprite.Height);
                renderer.ApplyTexture((uint)Id);
                renderer.UpdateTexture((uint)Id, sprite);
            }
        }
 public void DrawLayerQuad(vec2d_f offset, vec2d_f scale, Pixel tint)
 {
     GL.Begin(PrimitiveType.Quads);
     GL.Color4(tint.r, tint.g, tint.b, tint.a);
     GL.TexCoord2(0.0f * scale.x + offset.x, 1.0f * scale.y + offset.y);
     GL.Vertex3(-1.0f, -1.0f, 0.0f);
     GL.TexCoord2(0.0f * scale.x + offset.x, 0.0f * scale.y + offset.y);
     GL.Vertex3(-1.0f, 1.0f, 0.0f);
     GL.TexCoord2(1.0f * scale.x + offset.x, 0.0f * scale.y + offset.y);
     GL.Vertex3(1.0f, 1.0f, 0.0f);
     GL.TexCoord2(1.0f * scale.x + offset.x, 1.0f * scale.y + offset.y);
     GL.Vertex3(1.0f, -1.0f, 0.0f);
     GL.End();
 }
Esempio n. 3
0
 public DecalInstance()
 {
     pos = new vec2d_f[] { new vec2d_f(), new vec2d_f(), new vec2d_f(), new vec2d_f() };
     uv  = new vec2d_f[] { new vec2d_f(0.0f, 0.0f), new vec2d_f(0.0f, 1.0f), new vec2d_f(1.0f, 1.0f), new vec2d_f(1.0f, 0.0f) };
     w   = new float[] { 1.0f, 1.0f, 1.0f, 1.0f };
 }