|
@@ -14,8 +14,8 @@ FontRenderer::FontRenderer() : activeTex(0), scale(1) {
|
|
|
float FontRenderer::drawString(float x, float y, const char* text) {
|
|
|
const int maxIndex = 256;
|
|
|
|
|
|
- Buffer<sizeof (float) * maxIndex * 4 * 8 > buffer;
|
|
|
-
|
|
|
+ Buffer buffer(sizeof (float) * maxIndex * 4 * 8);
|
|
|
+
|
|
|
int index = 0;
|
|
|
Color4 color(0xFF, 0xFF, 0xFF, 0xFF);
|
|
|
|
|
@@ -43,7 +43,7 @@ float FontRenderer::drawString(float x, float y, const char* text) {
|
|
|
float minY = (c >> 4) * (1.0f / 16.0f);
|
|
|
float maxX = minX + (1.0f / 16.0f) - 2.0f / 128.0f;
|
|
|
float maxY = minY + (1.0f / 16.0f);
|
|
|
-
|
|
|
+
|
|
|
buffer.add(x).add(y).add(minX).add(minY).add(color);
|
|
|
buffer.add(x).add(y + addY).add(minX).add(maxY).add(color);
|
|
|
buffer.add(x + addX).add(y).add(maxX).add(minY).add(color);
|
|
@@ -55,7 +55,7 @@ float FontRenderer::drawString(float x, float y, const char* text) {
|
|
|
|
|
|
tex[activeTex].bindTo(0);
|
|
|
vertexBuffer.updateData(0, buffer.getLength(), buffer);
|
|
|
- vertexBuffer.drawStrip(buffer.getLength() / (4 * sizeof(float) + sizeof(Color4)));
|
|
|
+ vertexBuffer.drawStrip(buffer.getLength() / (4 * sizeof (float) + sizeof (Color4)));
|
|
|
return y + addY;
|
|
|
}
|
|
|
|