X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fscreen.h;h=66590e717bd238046d30b27f3ac18cbe08ebf70e;hp=44dd2c723be7ea089fdc962c4c7bd8a826bc2571;hb=700f1449af19115ff2bbe50ad67ea7c73f9aa5cd;hpb=b1786b24148036a4d9402cc12ea97466072e988d diff --git a/src/screen.h b/src/screen.h index 44dd2c7..66590e7 100644 --- a/src/screen.h +++ b/src/screen.h @@ -5,6 +5,8 @@ #include +#include "stb_truetype.h" + namespace IPDF { /* @@ -30,6 +32,12 @@ namespace IPDF int ViewportWidth() const { return m_viewport_width; } int ViewportHeight() const { return m_viewport_height; } + // Debug Font handling + void DebugFontInit(const char *font_name, float font_size = 12); + void DebugFontClear(); + void DebugFontPrint(const char *str); + void DebugFontPrintF(const char *fmt, ...); + // Handle mouse input. typedef std::function MouseHandler; void SetMouseHandler(MouseHandler handler) @@ -60,6 +68,11 @@ namespace IPDF int m_viewport_height; SDL_Window *m_window; SDL_GLContext m_gl_context; + stbtt_bakedchar m_debug_font_rects[96]; + unsigned int m_debug_font_atlas; + float m_debug_font_x; + float m_debug_font_y; + float m_debug_font_size; }; }