Exemple #1
0
 public void DrawTexture(Texture texture, Rect rect, Color color)
 {
     TextureRenderer.ColoredTexturedVertex[] data = new TextureRenderer.ColoredTexturedVertex[]
     {
         new TextureRenderer.ColoredTexturedVertex((float)rect.X, (float)rect.Y, 0f, 0f, color),
         new TextureRenderer.ColoredTexturedVertex((float)(rect.X + rect.W), (float)rect.Y, 1f, 0f, color),
         new TextureRenderer.ColoredTexturedVertex((float)(rect.X + rect.W), (float)(rect.Y + rect.H), 1f, 1f, color),
         new TextureRenderer.ColoredTexturedVertex((float)rect.X, (float)(rect.Y + rect.H), 0f, 1f, color)
     };
     this.dx.SetTexture(0, texture);
     SendVerticesToDevice(data, 2, PrimitiveType.TriangleFan, TextureRenderer.ColoredTexturedVertex.VertexElements);
 }
Exemple #2
0
 public ColoredTexturedVertex(float x, float y, float u, float v, Color color)
 {
     this = new TextureRenderer.ColoredTexturedVertex(x, y, 0f, u, v, color);
 }