Make the FontRenderer's Bitmap struct opaque outside the library

This commit is contained in:
Francesco Abbate
2020-06-11 17:52:00 +02:00
parent ce664f85b1
commit 117714390a
3 changed files with 37 additions and 30 deletions
+6 -8
View File
@@ -12,13 +12,7 @@ typedef struct {
float xoff, yoff, xadvance;
} GlyphBitmapInfo;
// Important: when a subpixel scale is used the width below will be the width in logical pixel.
// As each logical pixel contains 3 subpixels it means that the 'pixels' pointer
// will hold enough space for '3 * width' uint8_t values.
typedef struct {
uint8_t *pixels;
int width, height;
} FontRendererBitmap;
typedef struct FontRendererBitmap FontRendererBitmap;
struct FontRendererImpl;
typedef struct FontRendererImpl FontRenderer;
@@ -46,7 +40,7 @@ int FontRendererLoadFont(FontRenderer *, const char *filename);
int FontRendererGetFontHeight(FontRenderer *, float size);
int FontRendererBakeFontBitmap(FontRenderer *, int font_height,
void *pixels, int pixels_width, int pixels_height,
FontRendererBitmap *image,
int first_char, int num_chars, GlyphBitmapInfo *glyph_info,
int subpixel_scale);
@@ -65,6 +59,10 @@ void FontRendererBlendGammaSubpixel(FontRenderer *font_renderer,
const FontRendererBitmap *glyphs_bitmap,
const GlyphBitmapInfo *glyph, FontRendererColor color);
FontRendererBitmap* FontRendererBitmapNew(int width, int height, int subpixel_scale);
void FontRendererBitmapFree(FontRendererBitmap *image);
#ifdef __cplusplus
}
#endif