From 9dc0b58566153884304b583f371f9649cafe0353 Mon Sep 17 00:00:00 2001 From: Jacob Dennis Date: Mon, 31 Oct 2022 16:47:35 +0000 Subject: [PATCH] Added Image struct def, updated Font struct to match raylib (#236) Image is required for RAYGUI_STANDALONE flag to work Font was out of sync with raylib master Co-authored-by: jobat --- src/raygui.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index 57074dd..4def1ef 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -298,6 +298,15 @@ int format; // Data format (PixelFormat type) } Texture2D; + // Image, pixel data stored in CPU memory (RAM) + typedef struct Image { + void *data; // Image raw data + int width; // Image base width + int height; // Image base height + int mipmaps; // Mipmap levels, 1 by default + int format; // Data format (PixelFormat type) + } Image; + // GlyphInfo, font characters glyphs info typedef struct GlyphInfo { int value; // Character value (Unicode) @@ -311,11 +320,13 @@ // It should be redesigned to be provided by user typedef struct Font { int baseSize; // Base size (default chars height) - int glyphCount; // Number of characters - Texture2D texture; // Characters texture atlas - Rectangle *recs; // Characters rectangles in texture - GlyphInfo *chars; // Characters info data + int glyphCount; // Number of glyph characters + int glyphPadding; // Padding around the glyph characters + Texture2D texture; // Texture atlas containing the glyphs + Rectangle *recs; // Rectangles in texture for the glyphs + GlyphInfo *glyphs; // Glyphs info data } Font; + #endif // Style property