Compare commits

..

3 commits

2 changed files with 5 additions and 6 deletions

View file

@ -8,18 +8,18 @@
extern int viewportWidth, viewportHeight; extern int viewportWidth, viewportHeight;
extern Texture* debugFontTexture; extern Texture* debugFontTexture;
extern Shader* fontShader; extern Shader* debugFontShader;
extern Shader* identityShader; extern Shader* identityShader;
void drawChar(char c, int x, int y, float scale=1.f) { void drawChar(char c, int x, int y, float scale=1.f) {
fontShader->use(); debugFontShader->use();
debugFontTexture->activate(1); debugFontTexture->activate(1);
fontShader->set("fontTex", 1); debugFontShader->set("fontTex", 1);
fontShader->set("charIndex", (int)c); debugFontShader->set("charIndex", (int)c);
// https://stackoverflow.com/a/10631263 // https://stackoverflow.com/a/10631263
int tex = fontShader->getAttribute("aTexCoord"); int tex = debugFontShader->getAttribute("aTexCoord");
y = viewportHeight - y - 16*scale; y = viewportHeight - y - 16*scale;
float x0 = float(x)/viewportWidth, y0 = float(y)/viewportHeight, x1 = ((float)x + 8*scale)/viewportWidth, y1 = ((float)y + 16*scale)/viewportHeight; float x0 = float(x)/viewportWidth, y0 = float(y)/viewportHeight, x1 = ((float)x + 8*scale)/viewportWidth, y1 = ((float)y + 16*scale)/viewportHeight;

View file

@ -671,7 +671,6 @@ void render() {
// TODO: Make this a debug flag // TODO: Make this a debug flag
// renderAABB(); // renderAABB();
drawText(sansSerif, "Hi", 0, 0, 1);
renderTime = tu_clock_micros() - startTime; renderTime = tu_clock_micros() - startTime;
} }