Commits

Anonymous committed 0a982a5

Configuration::pointSize()

  • Participants
  • Parent commits 24a571c

Comments (0)

Files changed (2)

File code/common/common.h

 		static OPENGL_FEATURE_LEVEL featureLevel = OPENGL_1_1;
 		return featureLevel;
 	}
+
+	// Size of one point in pixels. For fonts to be same size on retina and non-retina
+	static float& pointSize()
+	{
+		static float pointSize = 1.0f;
+		return pointSize;
+	}
 };
 
 struct Touch

File code/payload/FontManager.h

 			int index = (int)text[i];
 			const Font::Character& ch = font.chars[index];
 			
-			float w = (float)ch.width  / Configuration::screenWidth();
-			float h = (float)ch.height / Configuration::screenHeight();
+			float w = Configuration::pointSize() * (float)ch.width  / Configuration::screenWidth();
+			float h = Configuration::pointSize() * (float)ch.height / Configuration::screenHeight();
 			
 			float u0 = ch.x / 512.0f, u1 = (ch.x + ch.width)  / 512.0f;
 			float v0 = ch.y / 512.0f, v1 = (ch.y + ch.height) / 512.0f;