#pragma once #include #include #define GLYPH_CELL_W 32 #define GLYPH_CELL_H 32 #define GLYPH_ATLAS_COLS 16 #define GLYPH_ATLAS_ROWS 16 #define GLYPH_ATLAS_SIZE (GLYPH_ATLAS_COLS * GLYPH_CELL_W) typedef struct { ID3D11Texture2D* texture; ID3D11ShaderResourceView* srv; int atlas_w; int atlas_h; int next_x; int next_y; int cell_w; int cell_h; float u_scale; float v_scale; } GlyphAtlas; int glyph_atlas_init(GlyphAtlas* ga, ID3D11Device* dev); void glyph_atlas_destroy(GlyphAtlas* ga); int glyph_atlas_get_or_create(GlyphAtlas* ga, ID3D11Device* dev, ID3D11DeviceContext* ctx, wchar_t ch, float* u0, float* v0, float* u1, float* v1, float* advance_x, float* advance_y);