Browse Source

Images, Canvases, Quads, and Fonts now have the same vertex winding order

Alex Szpakowski 11 years ago
parent
commit
c8f5494900
2 changed files with 10 additions and 10 deletions
  1. 8 8
      src/modules/graphics/opengl/Canvas.cpp
  2. 2 2
      src/modules/graphics/opengl/Font.cpp

+ 8 - 8
src/modules/graphics/opengl/Canvas.cpp

@@ -376,22 +376,22 @@ Canvas::Canvas(int width, int height, TextureType texture_type)
 	// world coordinates
 	vertices[0].x = 0;
 	vertices[0].y = h;
-	vertices[1].x = 0;
-	vertices[1].y = 0;
+	vertices[1].x = w;
+	vertices[1].y = h;
 	vertices[2].x = w;
 	vertices[2].y = 0;
-	vertices[3].x = w;
-	vertices[3].y = h;
+	vertices[3].x = 0;
+	vertices[3].y = 0;
 
 	// texture coordinates
 	vertices[0].s = 0;
 	vertices[0].t = 0;
-	vertices[1].s = 0;
-	vertices[1].t = 1;
+	vertices[1].s = 1;
+	vertices[1].t = 0;
 	vertices[2].s = 1;
 	vertices[2].t = 1;
-	vertices[3].s = 1;
-	vertices[3].t = 0;
+	vertices[3].s = 0;
+	vertices[3].t = 1;
 
 	settings.filter = Image::getDefaultFilter();
 

+ 2 - 2
src/modules/graphics/opengl/Font.cpp

@@ -216,9 +216,9 @@ Font::Glyph *Font::addGlyph(uint32 glyph)
 
 		const GlyphVertex verts[4] = {
 			{    0.0f,     0.0f, float(textureX)/float(textureWidth),   float(textureY)/float(textureHeight)},
-			{float(w),     0.0f, float(textureX+w)/float(textureWidth), float(textureY)/float(textureHeight)},
-			{float(w), float(h), float(textureX+w)/float(textureWidth), float(textureY+h)/float(textureHeight)},
 			{    0.0f, float(h), float(textureX)/float(textureWidth),   float(textureY+h)/float(textureHeight)},
+			{float(w), float(h), float(textureX+w)/float(textureWidth), float(textureY+h)/float(textureHeight)},
+			{float(w),     0.0f, float(textureX+w)/float(textureWidth), float(textureY)/float(textureHeight)},
 		};
 
 		// copy vertex data to the glyph and set proper bearing