public void Draw(int x, int y, float z, float rotate, float sx, float sy, bool blend) { if (Vbo == null) { CreateVBO(false); } Bind(0); GLExt.PushMatrix(); { GLExt.Translate(x, y, z); GLExt.RotateZ(rotate); GLExt.Scale(sx, sy, 1); if (blend) { GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); Vbo.Render(); GL.Disable(EnableCap.Blend); } else { Vbo.Render(); } } GLExt.PopMatrix(); }
void DrawChar(int ch) { float u = uv[ch].x; float v = uv[ch].y; float w = uv[ch].w; float h = uv[ch].h; float wm = w * Size; float hm = h * Size; letter[0].UV.X = u; letter[0].UV.Y = v; letter[1].UV.X = u + w; letter[1].UV.Y = v; letter[1].Position.X = wm; letter[2].UV.X = u + w; letter[2].UV.Y = v + h; letter[2].Position.X = wm; letter[2].Position.Y = hm; letter[3].UV.X = u; letter[3].UV.Y = v + h; letter[3].Position.Y = hm; vbo.Update(letter); vbo.Render(); }