public override void DrawDecal(DecalInstance decal)
        {
            SetDecalMode(decal.mode);
            if (decal.decal == null)
            {
                GL.BindTexture(TextureTarget.Texture2D, rendBlankQuad.Decal().id);
            }
            else
            {
                GL.BindTexture(TextureTarget.Texture2D, decal.decal.id);
            }

            GL.BindBuffer(BufferTarget.ArrayBuffer, m_vbQuad);
            Bvert[] pVertexMem = new Bvert[decal.points];

            for (int i = 0; i < decal.points; i++)
            {
                pVertexMem[i] = new Bvert(new float[3] {
                    decal.pos[i].x, decal.pos[i].y, decal.w[i]
                }, new vf2d(decal.uv[i].x, decal.uv[i].y), decal.tint[i]);
            }

            int vertexSize = Marshal.SizeOf(typeof(Bvert));

            GL.BufferData(BufferTarget.ArrayBuffer, (int)(vertexSize * decal.points), pVertexMem, BufferUsageHint.StreamDraw);

            if (nDecalMode == DecalMode.WIREFRAME)
            {
                GL.DrawArrays(PrimitiveType.LineLoop, 0, (int)decal.points);
            }
            else
            {
                GL.DrawArrays(PrimitiveType.TriangleFan, 0, (int)decal.points);
            }
        }
Esempio n. 2
0
 public abstract void DrawDecal(DecalInstance decal);