Add debug rendering, fix misaligned pos render bug

Rendering using a non-default quad specifies normalised coordinates
relative to the frame buffer size. Hence each render of these frames
should origin from (0,0) any other value is invalid.
This commit is contained in:
2016-07-08 02:45:37 +10:00
parent a04c43681d
commit 46629a489a
10 changed files with 210 additions and 111 deletions
+2 -2
View File
@@ -9,7 +9,7 @@
#include "Dengine/Platform.h"
#include "Dengine/AssetManager.h"
#define WT_RENDER_FONT_FILE
//#define WT_RENDER_FONT_FILE
#ifdef WT_RENDER_FONT_FILE
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include <STB/stb_image_write.h>
@@ -136,7 +136,7 @@ const i32 asset_loadTTFont(AssetManager *assetManager, const char *filePath)
CAST(GlyphBitmap *) calloc(numGlyphs, sizeof(GlyphBitmap));
v2i largestGlyphDimension = V2i(0, 0);
const f32 targetFontHeight = 32.0f;
const f32 targetFontHeight = 20.0f;
f32 scaleY = stbtt_ScaleForPixelHeight(&fontInfo, targetFontHeight);
i32 ascent, descent, lineGap;