From 0ddb83affe5caccc21efb2c3ee70350901f0107f Mon Sep 17 00:00:00 2001 From: Antonis Geralis Date: Thu, 24 Oct 2024 22:47:36 +0300 Subject: [PATCH] try to remove patch --- mangle_names.patch | 1261 --------------------- src/raylib.nim | 81 +- src/raylib/external/jar_xm.h | 60 +- src/raylib/naylib.h | 3 + src/raylib/platforms/rcore_android.c | 10 +- src/raylib/platforms/rcore_desktop_glfw.c | 2 +- src/raylib/platforms/rcore_desktop_sdl.c | 2 +- src/raylib/platforms/rcore_drm.c | 4 +- src/raylib/platforms/rcore_template.c | 2 +- src/raylib/platforms/rcore_web.c | 2 +- src/raylib/raylib.h | 72 +- src/raylib/rcore.c | 12 +- src/raylib/rmodels.c | 8 +- src/raylib/rshapes.c | 70 +- src/raylib/rtext.c | 50 +- src/raylib/rtextures.c | 58 +- tests/basic_window.nim | 24 +- update_bindings.nims | 8 +- wrapper/builder.nim | 5 +- wrapper/config/raylib.cfg | 11 +- wrapper/processor.nim | 2 + 21 files changed, 248 insertions(+), 1499 deletions(-) delete mode 100644 mangle_names.patch create mode 100644 src/raylib/naylib.h diff --git a/mangle_names.patch b/mangle_names.patch deleted file mode 100644 index bed2ac3..0000000 --- a/mangle_names.patch +++ /dev/null @@ -1,1261 +0,0 @@ -From c083a5e73b5b78cc884c17e2d46f4981cd148858 Mon Sep 17 00:00:00 2001 -From: Antonis Geralis -Date: Thu, 24 Oct 2024 19:53:54 +0300 -Subject: [PATCH] mangle names - ---- - src/raylib/external/jar_xm.h | 60 +++++++++---------- - src/raylib/platforms/rcore_android.c | 10 ++-- - src/raylib/platforms/rcore_desktop_glfw.c | 2 +- - src/raylib/platforms/rcore_desktop_sdl.c | 2 +- - src/raylib/platforms/rcore_drm.c | 4 +- - src/raylib/platforms/rcore_template.c | 2 +- - src/raylib/platforms/rcore_web.c | 2 +- - src/raylib/raylib.h | 72 +++++++++++------------ - src/raylib/rcore.c | 12 ++-- - src/raylib/rmodels.c | 8 +-- - src/raylib/rshapes.c | 70 +++++++++++----------- - src/raylib/rtext.c | 50 ++++++++-------- - src/raylib/rtextures.c | 58 +++++++++--------- - 13 files changed, 176 insertions(+), 176 deletions(-) - -diff --git a/src/raylib/external/jar_xm.h b/src/raylib/external/jar_xm.h -index b5e80e4..5459410 100644 ---- a/src/raylib/external/jar_xm.h -+++ b/src/raylib/external/jar_xm.h -@@ -2373,23 +2373,23 @@ void jar_xm_debug(jar_xm_context_t *ctx) { - int x = 0, y = 0; - - // DEBUG VARIABLES -- y += size; DrawText(TextFormat("CUR TBL = %i", ctx->current_table_index), x, y, size, WHITE); -- y += size; DrawText(TextFormat("CUR PAT = %i", ctx->module.pattern_table[ctx->current_table_index]), x, y, size, WHITE); -- y += size; DrawText(TextFormat("POS JMP = %d", ctx->position_jump), x, y, size, WHITE); -- y += size; DrawText(TextFormat("JMP DST = %i", ctx->jump_dest), x, y, size, WHITE); -- y += size; DrawText(TextFormat("PTN BRK = %d", ctx->pattern_break), x, y, size, WHITE); -- y += size; DrawText(TextFormat("CUR ROW = %i", ctx->current_row), x, y, size, WHITE); -- y += size; DrawText(TextFormat("JMP ROW = %i", ctx->jump_row), x, y, size, WHITE); -- y += size; DrawText(TextFormat("ROW LCT = %i", ctx->row_loop_count), x, y, size, WHITE); -- y += size; DrawText(TextFormat("LCT = %i", ctx->loop_count), x, y, size, WHITE); -- y += size; DrawText(TextFormat("MAX LCT = %i", ctx->max_loop_count), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("CUR TBL = %i", ctx->current_table_index), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("CUR PAT = %i", ctx->module.pattern_table[ctx->current_table_index]), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("POS JMP = %d", ctx->position_jump), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("JMP DST = %i", ctx->jump_dest), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("PTN BRK = %d", ctx->pattern_break), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("CUR ROW = %i", ctx->current_row), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("JMP ROW = %i", ctx->jump_row), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("ROW LCT = %i", ctx->row_loop_count), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("LCT = %i", ctx->loop_count), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("MAX LCT = %i", ctx->max_loop_count), x, y, size, WHITE); - x = size * 12; y = 0; - -- y += size; DrawText(TextFormat("CUR TCK = %i", ctx->current_tick), x, y, size, WHITE); -- y += size; DrawText(TextFormat("XTR TCK = %i", ctx->extra_ticks), x, y, size, WHITE); -- y += size; DrawText(TextFormat("TCK/ROW = %i", ctx->tempo), x, y, size, ORANGE); -- y += size; DrawText(TextFormat("SPL TCK = %f", ctx->remaining_samples_in_tick), x, y, size, WHITE); -- y += size; DrawText(TextFormat("GEN SPL = %i", ctx->generated_samples), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("CUR TCK = %i", ctx->current_tick), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("XTR TCK = %i", ctx->extra_ticks), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("TCK/ROW = %i", ctx->tempo), x, y, size, ORANGE); -+ y += size; rlDrawText(TextFormat("SPL TCK = %f", ctx->remaining_samples_in_tick), x, y, size, WHITE); -+ y += size; rlDrawText(TextFormat("GEN SPL = %i", ctx->generated_samples), x, y, size, WHITE); - y += size * 7; - - x = 0; -@@ -2404,13 +2404,13 @@ void jar_xm_debug(jar_xm_context_t *ctx) { - }; - }; - if (i == ctx->current_table_index) { --// DrawText(TextFormat("%02X", ctx->current_tick), i * size * 2, y - size, size, WHITE); -+// rlDrawText(TextFormat("%02X", ctx->current_tick), i * size * 2, y - size, size, WHITE); - DrawRectangle(i * size * 2, y, size * 2, size, RED); -- DrawText(TextFormat("%02X", ctx->current_row), i * size * 2, y - size, size, YELLOW); -+ rlDrawText(TextFormat("%02X", ctx->current_row), i * size * 2, y - size, size, YELLOW); - } else { - DrawRectangle(i * size * 2, y, size * 2, size, ORANGE); - }; -- DrawText(TextFormat("%02X", ctx->module.pattern_table[i]), i * size * 2, y, size, WHITE); -+ rlDrawText(TextFormat("%02X", ctx->module.pattern_table[i]), i * size * 2, y, size, WHITE); - }; - y += size; - -@@ -2421,10 +2421,10 @@ void jar_xm_debug(jar_xm_context_t *ctx) { - x += 2 * size; - for(uint8_t i = 0; i < ctx->module.num_channels; i++) { - DrawRectangle(x, y, 8 * size, size, PURPLE); -- DrawText("N", x, y, size, YELLOW); -- DrawText("I", x + size * 2, y, size, YELLOW); -- DrawText("V", x + size * 4, y, size, YELLOW); -- DrawText("FX", x + size * 6, y, size, YELLOW); -+ rlDrawText("N", x, y, size, YELLOW); -+ rlDrawText("I", x + size * 2, y, size, YELLOW); -+ rlDrawText("V", x + size * 4, y, size, YELLOW); -+ rlDrawText("FX", x + size * 6, y, size, YELLOW); - x += 9 * size; - }; - x += size; -@@ -2433,7 +2433,7 @@ void jar_xm_debug(jar_xm_context_t *ctx) { - x = 0; - if (j >=0 && j < (cur->num_rows)) { - DrawRectangle(x, y, size * 2, size, BROWN); -- DrawText(TextFormat("%02X",j), x, y, size, WHITE); -+ rlDrawText(TextFormat("%02X",j), x, y, size, WHITE); - x += 2 * size; - for(uint8_t i = 0; i < ctx->module.num_channels; i++) { - if (j==(ctx->current_row)) { -@@ -2443,20 +2443,20 @@ void jar_xm_debug(jar_xm_context_t *ctx) { - }; - jar_xm_pattern_slot_t *s = cur->slots + j * ctx->module.num_channels + i; - // jar_xm_channel_context_t *ch = ctx->channels + i; -- if (s->note > 0) {DrawText(TextFormat("%s%s", xm_note_chr(s->note), xm_octave_chr(s->note) ), x, y, size, WHITE);} else {DrawText("...", x, y, size, GRAY);}; -+ if (s->note > 0) {rlDrawText(TextFormat("%s%s", xm_note_chr(s->note), xm_octave_chr(s->note) ), x, y, size, WHITE);} else {rlDrawText("...", x, y, size, GRAY);}; - if (s->instrument > 0) { -- DrawText(TextFormat("%02X", s->instrument), x + size * 2, y, size, WHITE); -+ rlDrawText(TextFormat("%02X", s->instrument), x + size * 2, y, size, WHITE); - if (s->volume_column == 0) { -- DrawText(TextFormat("%02X", 64), x + size * 4, y, size, YELLOW); -+ rlDrawText(TextFormat("%02X", 64), x + size * 4, y, size, YELLOW); - }; - } else { -- DrawText("..", x + size * 2, y, size, GRAY); -+ rlDrawText("..", x + size * 2, y, size, GRAY); - if (s->volume_column == 0) { -- DrawText("..", x + size * 4, y, size, GRAY); -+ rlDrawText("..", x + size * 4, y, size, GRAY); - }; - }; -- if (s->volume_column > 0) {DrawText(TextFormat("%02X", (s->volume_column - 16)), x + size * 4, y, size, WHITE);}; -- if (s->effect_type > 0 || s->effect_param > 0) {DrawText(TextFormat("%s%02X", xm_effect_chr(s->effect_type), s->effect_param), x + size * 6, y, size, WHITE);}; -+ if (s->volume_column > 0) {rlDrawText(TextFormat("%02X", (s->volume_column - 16)), x + size * 4, y, size, WHITE);}; -+ if (s->effect_type > 0 || s->effect_param > 0) {rlDrawText(TextFormat("%s%02X", xm_effect_chr(s->effect_type), s->effect_param), x + size * 6, y, size, WHITE);}; - x += 9 * size; - }; - }; -diff --git a/src/raylib/platforms/rcore_android.c b/src/raylib/platforms/rcore_android.c -index 85ce82a..d42d07e 100644 ---- a/src/raylib/platforms/rcore_android.c -+++ b/src/raylib/platforms/rcore_android.c -@@ -516,7 +516,7 @@ const char *GetClipboardText(void) - } - - // Show mouse cursor --void ShowCursor(void) -+void rlShowCursor(void) - { - CORE.Input.Mouse.cursorHidden = false; - } -@@ -1004,16 +1004,16 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) - #if defined(SUPPORT_MODULE_RSHAPES) - // Set font white rectangle for shapes drawing, so shapes and text can be batched together - // WARNING: rshapes module is required, if not available, default internal white rectangle is used -- Rectangle rec = GetFontDefault().recs[95]; -+ rlRectangle rec = GetFontDefault().recs[95]; - if (CORE.Window.flags & FLAG_MSAA_4X_HINT) - { - // NOTE: We try to maxime rec padding to avoid pixel bleeding on MSAA filtering -- SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 2, rec.y + 2, 1, 1 }); -+ SetShapesTexture(GetFontDefault().texture, (rlRectangle){ rec.x + 2, rec.y + 2, 1, 1 }); - } - else - { - // NOTE: We set up a 1px padding on char rectangle to avoid pixel bleeding -- SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); -+ SetShapesTexture(GetFontDefault().texture, (rlRectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); - } - #endif - #else -@@ -1021,7 +1021,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) - // Set default texture and rectangle to be used for shapes drawing - // NOTE: rlgl default texture is a 1x1 pixel UNCOMPRESSED_R8G8B8A8 - Texture2D texture = { rlGetTextureIdDefault(), 1, 1, 1, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 }; -- SetShapesTexture(texture, (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); // WARNING: Module required: rshapes -+ SetShapesTexture(texture, (rlRectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); // WARNING: Module required: rshapes - #endif - #endif - -diff --git a/src/raylib/platforms/rcore_desktop_glfw.c b/src/raylib/platforms/rcore_desktop_glfw.c -index 41f7fac..852b59b 100644 ---- a/src/raylib/platforms/rcore_desktop_glfw.c -+++ b/src/raylib/platforms/rcore_desktop_glfw.c -@@ -966,7 +966,7 @@ const char *GetClipboardText(void) - } - - // Show mouse cursor --void ShowCursor(void) -+void rlShowCursor(void) - { - glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - CORE.Input.Mouse.cursorHidden = false; -diff --git a/src/raylib/platforms/rcore_desktop_sdl.c b/src/raylib/platforms/rcore_desktop_sdl.c -index 7cbe035..fd57ad2 100644 ---- a/src/raylib/platforms/rcore_desktop_sdl.c -+++ b/src/raylib/platforms/rcore_desktop_sdl.c -@@ -878,7 +878,7 @@ const char *GetClipboardText(void) - } - - // Show mouse cursor --void ShowCursor(void) -+void rlShowCursor(void) - { - SDL_ShowCursor(SDL_ENABLE); - -diff --git a/src/raylib/platforms/rcore_drm.c b/src/raylib/platforms/rcore_drm.c -index eb8ef01..18a5d69 100644 ---- a/src/raylib/platforms/rcore_drm.c -+++ b/src/raylib/platforms/rcore_drm.c -@@ -119,7 +119,7 @@ typedef struct { - char currentButtonStateEvdev[MAX_MOUSE_BUTTONS]; // Holds the new mouse state for the next polling event to grab - bool cursorRelative; // Relative cursor mode - int mouseFd; // File descriptor for the evdev mouse/touch/gestures -- Rectangle absRange; // Range of values for absolute pointing devices (touchscreens) -+ rlRectangle absRange; // Range of values for absolute pointing devices (touchscreens) - int touchSlot; // Hold the touch slot number of the currently being sent multitouch block - - // Gamepad data -@@ -510,7 +510,7 @@ const char *GetClipboardText(void) - } - - // Show mouse cursor --void ShowCursor(void) -+void rlShowCursor(void) - { - CORE.Input.Mouse.cursorHidden = false; - } -diff --git a/src/raylib/platforms/rcore_template.c b/src/raylib/platforms/rcore_template.c -index 6bc3432..1f8c116 100644 ---- a/src/raylib/platforms/rcore_template.c -+++ b/src/raylib/platforms/rcore_template.c -@@ -293,7 +293,7 @@ const char *GetClipboardText(void) - } - - // Show mouse cursor --void ShowCursor(void) -+void rlShowCursor(void) - { - CORE.Input.Mouse.cursorHidden = false; - } -diff --git a/src/raylib/platforms/rcore_web.c b/src/raylib/platforms/rcore_web.c -index e15d3f5..0138c61 100644 ---- a/src/raylib/platforms/rcore_web.c -+++ b/src/raylib/platforms/rcore_web.c -@@ -806,7 +806,7 @@ const char *GetClipboardText(void) - } - - // Show mouse cursor --void ShowCursor(void) -+void rlShowCursor(void) - { - if (CORE.Input.Mouse.cursorHidden) - { -diff --git a/src/raylib/raylib.h b/src/raylib/raylib.h -index c9d9f6e..38e2d56 100644 ---- a/src/raylib/raylib.h -+++ b/src/raylib/raylib.h -@@ -252,12 +252,12 @@ typedef struct Color { - } Color; - - // Rectangle, 4 components --typedef struct Rectangle { -+typedef struct rlRectangle { - float x; // Rectangle top-left corner position x - float y; // Rectangle top-left corner position y - float width; // Rectangle width - float height; // Rectangle height --} Rectangle; -+} rlRectangle; - - // Image, pixel data stored in CPU memory (RAM) - typedef struct Image { -@@ -295,7 +295,7 @@ typedef RenderTexture RenderTexture2D; - - // NPatchInfo, n-patch layout info - typedef struct NPatchInfo { -- Rectangle source; // Texture source rectangle -+ rlRectangle source; // Texture source rectangle - int left; // Left border offset - int top; // Top border offset - int right; // Right border offset -@@ -318,7 +318,7 @@ typedef struct Font { - 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 -+ rlRectangle *recs; // Rectangles in texture for the glyphs - GlyphInfo *glyphs; // Glyphs info data - } Font; - -@@ -966,7 +966,7 @@ extern "C" { // Prevents name mangling of functions - - // Window-related functions - RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context --RLAPI void CloseWindow(void); // Close window and unload OpenGL context -+RLAPI void rlCloseWindow(void); // Close window and unload OpenGL context - RLAPI bool WindowShouldClose(void); // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) - RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully - RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen -@@ -1015,7 +1015,7 @@ RLAPI void EnableEventWaiting(void); // Enable wait - RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling - - // Cursor-related functions --RLAPI void ShowCursor(void); // Shows cursor -+RLAPI void rlShowCursor(void); // Shows cursor - RLAPI void HideCursor(void); // Hides cursor - RLAPI bool IsCursorHidden(void); // Check if cursor is not visible - RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) -@@ -1238,9 +1238,9 @@ RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, f - // Set texture and rectangle to be used on shapes drawing - // NOTE: It can be useful when using basic shapes and one single font, - // defining a font char white rectangle would allow drawing everything in a single draw call --RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing -+RLAPI void SetShapesTexture(Texture2D texture, rlRectangle source); // Set texture and rectangle to be used on shapes drawing - RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing --RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing -+RLAPI rlRectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing - - // Basic shapes drawing functions - RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care] -@@ -1263,16 +1263,16 @@ RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float - RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline - RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle - RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) --RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle --RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters -+RLAPI void DrawRectangleRec(rlRectangle rec, Color color); // Draw a color-filled rectangle -+RLAPI void DrawRectanglePro(rlRectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters - RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle - RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle --RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors -+RLAPI void DrawRectangleGradientEx(rlRectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors - RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline --RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters --RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges --RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges --RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline -+RLAPI void DrawRectangleLinesEx(rlRectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters -+RLAPI void DrawRectangleRounded(rlRectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -+RLAPI void DrawRectangleRoundedLines(rlRectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges -+RLAPI void DrawRectangleRoundedLinesEx(rlRectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline - RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) - RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) - RLAPI void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) -@@ -1301,17 +1301,17 @@ RLAPI Vector2 GetSplinePointBezierQuad(Vector2 p1, Vector2 c2, Vector2 p3, float - RLAPI Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t); // Get (evaluate) spline point: Cubic Bezier - - // Basic shapes collision detection functions --RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles -+RLAPI bool CheckCollisionRecs(rlRectangle rec1, rlRectangle rec2); // Check collision between two rectangles - RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles --RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle -+RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, rlRectangle rec); // Check collision between circle and rectangle - RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2] --RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -+RLAPI bool CheckCollisionPointRec(Vector2 point, rlRectangle rec); // Check if point is inside rectangle - RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle - RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle - RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] - RLAPI bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices - RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference --RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision -+RLAPI rlRectangle GetCollisionRec(rlRectangle rec1, rlRectangle rec2); // Get collision rectangle for two rectangles collision - - //------------------------------------------------------------------------------------ - // Texture Loading and Drawing Functions (Module: textures) -@@ -1319,7 +1319,7 @@ RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); - - // Image loading functions - // NOTE: These functions do not require GPU access --RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) -+RLAPI Image rlLoadImage(const char *fileName); // Load image from file into CPU memory (RAM) - RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data - RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) - RLAPI Image LoadImageAnimFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int *frames); // Load image sequence from memory buffer -@@ -1345,13 +1345,13 @@ RLAPI Image GenImageText(int width, int height, const char *text); - - // Image manipulation functions - RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) --RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece -+RLAPI Image ImageFromImage(Image image, rlRectangle rec); // Create an image from another image piece - RLAPI Image ImageFromChannel(Image image, int selectedChannel); // Create an image from a selected channel of another image (GRAYSCALE) - RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) - RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) - RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format - RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) --RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -+RLAPI void ImageCrop(Image *image, rlRectangle crop); // Crop an image to a defined rectangle - RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value - RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color - RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image -@@ -1378,7 +1378,7 @@ RLAPI Color *LoadImageColors(Image image); - RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) - RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() - RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() --RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle -+RLAPI rlRectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle - RLAPI Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position - - // Image drawing functions -@@ -1395,14 +1395,14 @@ RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius - RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version) - RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image - RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) --RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image --RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image -+RLAPI void ImageDrawRectangleRec(Image *dst, rlRectangle rec, Color color); // Draw rectangle within an image -+RLAPI void ImageDrawRectangleLines(Image *dst, rlRectangle rec, int thick, Color color); // Draw rectangle lines within an image - RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image - RLAPI void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image - RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image - RLAPI void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center) - RLAPI void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image --RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) -+RLAPI void ImageDraw(Image *dst, Image src, rlRectangle srcRec, rlRectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) - RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) - RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) - -@@ -1417,7 +1417,7 @@ RLAPI void UnloadTexture(Texture2D texture); - RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU) - RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) - RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data --RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data -+RLAPI void UpdateTextureRec(Texture2D texture, rlRectangle rec, const void *pixels); // Update GPU texture rectangle with new data - - // Texture configuration functions - RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture -@@ -1428,9 +1428,9 @@ RLAPI void SetTextureWrap(Texture2D texture, int wrap); - RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D - RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 - RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters --RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle --RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters --RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely -+RLAPI void DrawTextureRec(Texture2D texture, rlRectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -+RLAPI void DrawTexturePro(Texture2D texture, rlRectangle source, rlRectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -+RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, rlRectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely - - // Color/pixel related functions - RLAPI bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal -@@ -1463,15 +1463,15 @@ RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); - RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' - RLAPI bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked) - RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use --RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info -+RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, rlRectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info - RLAPI void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM) - RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM) - RLAPI bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success - - // Text drawing functions - RLAPI void DrawFPS(int posX, int posY); // Draw current FPS --RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) --RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters -+RLAPI void rlDrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -+RLAPI void rlDrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters - RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) - RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) - RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) -@@ -1482,7 +1482,7 @@ RLAPI int MeasureText(const char *text, int fontSize); - RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font - RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found - RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found --RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found -+RLAPI rlRectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found - - // Text codepoints management functions (unicode characters) - RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array -@@ -1564,8 +1564,8 @@ RLAPI void DrawModelPoints(Model model, Vector3 position, float scale, Color tin - RLAPI void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters - RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) - RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture --RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source --RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation -+RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, rlRectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source -+RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, rlRectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation - - // Mesh management functions - RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids -diff --git a/src/raylib/rcore.c b/src/raylib/rcore.c -index 9734972..6f95f1c 100644 ---- a/src/raylib/rcore.c -+++ b/src/raylib/rcore.c -@@ -664,16 +664,16 @@ void InitWindow(int width, int height, const char *title) - #if defined(SUPPORT_MODULE_RSHAPES) - // Set font white rectangle for shapes drawing, so shapes and text can be batched together - // WARNING: rshapes module is required, if not available, default internal white rectangle is used -- Rectangle rec = GetFontDefault().recs[95]; -+ rlRectangle rec = GetFontDefault().recs[95]; - if (CORE.Window.flags & FLAG_MSAA_4X_HINT) - { - // NOTE: We try to maxime rec padding to avoid pixel bleeding on MSAA filtering -- SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 2, rec.y + 2, 1, 1 }); -+ SetShapesTexture(GetFontDefault().texture, (rlRectangle){ rec.x + 2, rec.y + 2, 1, 1 }); - } - else - { - // NOTE: We set up a 1px padding on char rectangle to avoid pixel bleeding -- SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); -+ SetShapesTexture(GetFontDefault().texture, (rlRectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); - } - #endif - #endif -@@ -682,7 +682,7 @@ void InitWindow(int width, int height, const char *title) - // Set default texture and rectangle to be used for shapes drawing - // NOTE: rlgl default texture is a 1x1 pixel UNCOMPRESSED_R8G8B8A8 - Texture2D texture = { rlGetTextureIdDefault(), 1, 1, 1, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 }; -- SetShapesTexture(texture, (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); // WARNING: Module required: rshapes -+ SetShapesTexture(texture, (rlRectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); // WARNING: Module required: rshapes - #endif - #endif - -@@ -696,7 +696,7 @@ void InitWindow(int width, int height, const char *title) - } - - // Close window and unload OpenGL context --void CloseWindow(void) -+void rlCloseWindow(void) - { - #if defined(SUPPORT_GIF_RECORDING) - if (gifRecording) -@@ -898,7 +898,7 @@ void EndDrawing(void) - if ((int)(GetTime()/0.5)%2 == 1) - { - DrawCircle(30, CORE.Window.screen.height - 20, 10, MAROON); // WARNING: Module required: rshapes -- DrawText("GIF RECORDING", 50, CORE.Window.screen.height - 25, 10, RED); // WARNING: Module required: rtext -+ rlDrawText("GIF RECORDING", 50, CORE.Window.screen.height - 25, 10, RED); // WARNING: Module required: rtext - } - #endif - -diff --git a/src/raylib/rmodels.c b/src/raylib/rmodels.c -index ed15d96..a1ebe0d 100644 ---- a/src/raylib/rmodels.c -+++ b/src/raylib/rmodels.c -@@ -3816,13 +3816,13 @@ void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, floa - // Draw a billboard - void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint) - { -- Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; -+ rlRectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; - - DrawBillboardRec(camera, texture, source, position, (Vector2) { scale*fabsf((float)source.width/source.height), scale }, tint); - } - - // Draw a billboard (part of a texture defined by a rectangle) --void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint) -+void DrawBillboardRec(Camera camera, Texture2D texture, rlRectangle source, Vector3 position, Vector2 size, Color tint) - { - // NOTE: Billboard locked on axis-Y - Vector3 up = { 0.0f, 1.0f, 0.0f }; -@@ -3831,7 +3831,7 @@ void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector - } - - // Draw a billboard with additional parameters --void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) -+void DrawBillboardPro(Camera camera, Texture2D texture, rlRectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) - { - // Compute the up vector and the right vector - Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); -@@ -5149,7 +5149,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat - } - else // Check if image is provided as image path - { -- image = LoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri)); -+ image = rlLoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri)); - } - } - else if (cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer -diff --git a/src/raylib/rshapes.c b/src/raylib/rshapes.c -index ece5513..b8caddd 100644 ---- a/src/raylib/rshapes.c -+++ b/src/raylib/rshapes.c -@@ -80,7 +80,7 @@ - // Global Variables Definition - //---------------------------------------------------------------------------------- - static Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used on shapes drawing (white pixel loaded by rlgl) --static Rectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing -+static rlRectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing - - //---------------------------------------------------------------------------------- - // Module specific Functions Declaration -@@ -94,7 +94,7 @@ static float EaseCubicInOut(float t, float b, float c, float d); // Cubic eas - // Set texture and rectangle to be used on shapes drawing - // NOTE: It can be useful when using basic shapes and one single font, - // defining a font char white rectangle would allow drawing everything in a single draw call --void SetShapesTexture(Texture2D texture, Rectangle source) -+void SetShapesTexture(Texture2D texture, rlRectangle source) - { - // Reset texture to default pixel if required - // WARNING: Shapes texture should be probably better validated, -@@ -102,7 +102,7 @@ void SetShapesTexture(Texture2D texture, Rectangle source) - if ((texture.id == 0) || (source.width == 0) || (source.height == 0)) - { - texShapes = (Texture2D){ 1, 1, 1, 1, 7 }; -- texShapesRec = (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }; -+ texShapesRec = (rlRectangle){ 0.0f, 0.0f, 1.0f, 1.0f }; - } - else - { -@@ -118,7 +118,7 @@ Texture2D GetShapesTexture(void) - } - - // Get texture source rectangle that is used for shapes drawing --Rectangle GetShapesTextureRectangle(void) -+rlRectangle GetShapesTextureRectangle(void) - { - return texShapesRec; - } -@@ -134,7 +134,7 @@ void DrawPixelV(Vector2 position, Color color) - { - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - -@@ -312,7 +312,7 @@ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endA - - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - -@@ -540,7 +540,7 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startA - - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - for (int i = 0; i < segments; i++) -@@ -669,17 +669,17 @@ void DrawRectangle(int posX, int posY, int width, int height, Color color) - // NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues - void DrawRectangleV(Vector2 position, Vector2 size, Color color) - { -- DrawRectanglePro((Rectangle){ position.x, position.y, size.x, size.y }, (Vector2){ 0.0f, 0.0f }, 0.0f, color); -+ DrawRectanglePro((rlRectangle){ position.x, position.y, size.x, size.y }, (Vector2){ 0.0f, 0.0f }, 0.0f, color); - } - - // Draw a color-filled rectangle --void DrawRectangleRec(Rectangle rec, Color color) -+void DrawRectangleRec(rlRectangle rec, Color color) - { - DrawRectanglePro(rec, (Vector2){ 0.0f, 0.0f }, 0.0f, color); - } - - // Draw a color-filled rectangle with pro parameters --void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color) -+void DrawRectanglePro(rlRectangle rec, Vector2 origin, float rotation, Color color) - { - Vector2 topLeft = { 0 }; - Vector2 topRight = { 0 }; -@@ -720,7 +720,7 @@ void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color - - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - -@@ -762,20 +762,20 @@ void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color - // Draw a vertical-gradient-filled rectangle - void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom) - { -- DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, top, bottom, bottom, top); -+ DrawRectangleGradientEx((rlRectangle){ (float)posX, (float)posY, (float)width, (float)height }, top, bottom, bottom, top); - } - - // Draw a horizontal-gradient-filled rectangle - void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right) - { -- DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, left, left, right, right); -+ DrawRectangleGradientEx((rlRectangle){ (float)posX, (float)posY, (float)width, (float)height }, left, left, right, right); - } - - // Draw a gradient-filled rectangle --void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight) -+void DrawRectangleGradientEx(rlRectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight) - { - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - rlNormal3f(0.0f, 0.0f, 1.0f); -@@ -850,7 +850,7 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) - } - - // Draw rectangle outline with extended parameters --void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color) -+void DrawRectangleLinesEx(rlRectangle rec, float lineThick, Color color) - { - if ((lineThick > rec.width) || (lineThick > rec.height)) - { -@@ -869,10 +869,10 @@ void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color) - // BBBBBBBB - // - -- Rectangle top = { rec.x, rec.y, rec.width, lineThick }; -- Rectangle bottom = { rec.x, rec.y - lineThick + rec.height, rec.width, lineThick }; -- Rectangle left = { rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; -- Rectangle right = { rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; -+ rlRectangle top = { rec.x, rec.y, rec.width, lineThick }; -+ rlRectangle bottom = { rec.x, rec.y - lineThick + rec.height, rec.width, lineThick }; -+ rlRectangle left = { rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; -+ rlRectangle right = { rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; - - DrawRectangleRec(top, color); - DrawRectangleRec(bottom, color); -@@ -881,7 +881,7 @@ void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color) - } - - // Draw rectangle with rounded edges --void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color) -+void DrawRectangleRounded(rlRectangle rec, float roundness, int segments, Color color) - { - // Not a rounded rectangle - if ((roundness <= 0.0f) || (rec.width < 1) || (rec.height < 1 )) -@@ -937,7 +937,7 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co - - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - // Draw all the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner -@@ -1108,20 +1108,20 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co - - // Draw rectangle with rounded edges - // TODO: This function should be refactored to use RL_LINES, for consistency with other Draw*Lines() --void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color) -+void DrawRectangleRoundedLines(rlRectangle rec, float roundness, int segments, Color color) - { - DrawRectangleRoundedLinesEx(rec, roundness, segments, 1.0f, color); - } - - // Draw rectangle with rounded edges outline --void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color) -+void DrawRectangleRoundedLinesEx(rlRectangle rec, float roundness, int segments, float lineThick, Color color) - { - if (lineThick < 0) lineThick = 0; - - // Not a rounded rectangle - if (roundness <= 0.0f) - { -- DrawRectangleLinesEx((Rectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color); -+ DrawRectangleLinesEx((rlRectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color); - return; - } - -@@ -1180,7 +1180,7 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f - { - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - -@@ -1356,7 +1356,7 @@ void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) - { - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - rlColor4ub(color.r, color.g, color.b, color.a); -@@ -1410,7 +1410,7 @@ void DrawTriangleFan(const Vector2 *points, int pointCount, Color color) - if (pointCount >= 3) - { - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - rlColor4ub(color.r, color.g, color.b, color.a); -@@ -1471,7 +1471,7 @@ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color col - - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - for (int i = 0; i < sides; i++) -@@ -1540,7 +1540,7 @@ void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, fl - - #if defined(SUPPORT_QUADS_DRAW_MODE) - rlSetTexture(GetShapesTexture().id); -- Rectangle shapeRect = GetShapesTextureRectangle(); -+ rlRectangle shapeRect = GetShapesTextureRectangle(); - - rlBegin(RL_QUADS); - for (int i = 0; i < sides; i++) -@@ -2180,7 +2180,7 @@ Vector2 GetSplinePointBezierCubic(Vector2 startPos, Vector2 startControlPos, Vec - //---------------------------------------------------------------------------------- - - // Check if point is inside rectangle --bool CheckCollisionPointRec(Vector2 point, Rectangle rec) -+bool CheckCollisionPointRec(Vector2 point, rlRectangle rec) - { - bool collision = false; - -@@ -2241,7 +2241,7 @@ bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCoun - } - - // Check collision between two rectangles --bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2) -+bool CheckCollisionRecs(rlRectangle rec1, rlRectangle rec2) - { - bool collision = false; - -@@ -2269,7 +2269,7 @@ bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, floa - - // Check collision between circle and rectangle - // NOTE: Reviewed version to take into account corner limit case --bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec) -+bool CheckCollisionCircleRec(Vector2 center, float radius, rlRectangle rec) - { - bool collision = false; - -@@ -2367,9 +2367,9 @@ RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Ve - } - - // Get collision rectangle for two rectangles collision --Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) -+rlRectangle GetCollisionRec(rlRectangle rec1, rlRectangle rec2) - { -- Rectangle overlap = { 0 }; -+ rlRectangle overlap = { 0 }; - - float left = (rec1.x > rec2.x)? rec1.x : rec2.x; - float right1 = rec1.x + rec1.width; -diff --git a/src/raylib/rtext.c b/src/raylib/rtext.c -index 3510671..415aae4 100644 ---- a/src/raylib/rtext.c -+++ b/src/raylib/rtext.c -@@ -7,8 +7,8 @@ - * rtext module is included in the build - * - * #define SUPPORT_DEFAULT_FONT --* Load default raylib font on initialization to be used by DrawText() and MeasureText(). --* If no default font loaded, DrawTextEx() and MeasureTextEx() are required. -+* Load default raylib font on initialization to be used by rlDrawText() and MeasureText(). -+* If no default font loaded, rlDrawTextEx() and MeasureTextEx() are required. - * - * #define SUPPORT_FILEFORMAT_FNT - * #define SUPPORT_FILEFORMAT_TTF -@@ -261,7 +261,7 @@ extern void LoadFontDefault(void) - // Allocate space for our characters info data - // NOTE: This memory must be freed at end! --> Done by CloseWindow() - defaultFont.glyphs = (GlyphInfo *)RL_CALLOC(defaultFont.glyphCount, sizeof(GlyphInfo)); -- defaultFont.recs = (Rectangle *)RL_CALLOC(defaultFont.glyphCount, sizeof(Rectangle)); -+ defaultFont.recs = (rlRectangle *)RL_CALLOC(defaultFont.glyphCount, sizeof(rlRectangle)); - - int currentLine = 0; - int currentPosX = charsDivisor; -@@ -358,7 +358,7 @@ Font LoadFont(const char *fileName) - else - #endif - { -- Image image = LoadImage(fileName); -+ Image image = rlLoadImage(fileName); - if (image.data != NULL) font = LoadFontFromImage(image, MAGENTA, FONT_TTF_DEFAULT_FIRST_CHAR); - UnloadImage(image); - } -@@ -418,7 +418,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) - // We allocate a temporal arrays for chars data measures, - // once we get the actual number of chars, we copy data to a sized arrays - int tempCharValues[MAX_GLYPHS_FROM_IMAGE] = { 0 }; -- Rectangle tempCharRecs[MAX_GLYPHS_FROM_IMAGE] = { 0 }; -+ rlRectangle tempCharRecs[MAX_GLYPHS_FROM_IMAGE] = { 0 }; - - Color *pixels = LoadImageColors(image); - -@@ -498,7 +498,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) - // We got tempCharValues and tempCharsRecs populated with chars data - // Now we move temp data to sized charValues and charRecs arrays - font.glyphs = (GlyphInfo *)RL_MALLOC(font.glyphCount*sizeof(GlyphInfo)); -- font.recs = (Rectangle *)RL_MALLOC(font.glyphCount*sizeof(Rectangle)); -+ font.recs = (rlRectangle *)RL_MALLOC(font.glyphCount*sizeof(rlRectangle)); - - for (int i = 0; i < font.glyphCount; i++) - { -@@ -735,7 +735,7 @@ GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSiz - // Generate image font atlas using chars info - // NOTE: Packing method: 0-Default, 1-Skyline - #if defined(SUPPORT_FILEFORMAT_TTF) || defined(SUPPORT_FILEFORMAT_BDF) --Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod) -+Image GenImageFontAtlas(const GlyphInfo *glyphs, rlRectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod) - { - Image atlas = { 0 }; - -@@ -751,7 +751,7 @@ Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyp - glyphCount = (glyphCount > 0)? glyphCount : 95; - - // NOTE: Rectangles memory is loaded here! -- Rectangle *recs = (Rectangle *)RL_MALLOC(glyphCount*sizeof(Rectangle)); -+ rlRectangle *recs = (rlRectangle *)RL_MALLOC(glyphCount*sizeof(rlRectangle)); - - // Calculate image size based on total glyph width and glyph row count - int totalWidth = 0; -@@ -1035,7 +1035,7 @@ bool ExportFontAsCode(Font font, const char *fileName) - - // Save font recs data - byteCount += sprintf(txtData + byteCount, "// Font characters rectangles data\n"); -- byteCount += sprintf(txtData + byteCount, "static Rectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); -+ byteCount += sprintf(txtData + byteCount, "static rlRectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); - for (int i = 0; i < font.glyphCount; i++) - { - byteCount += sprintf(txtData + byteCount, " { %1.0f, %1.0f, %1.0f , %1.0f },\n", font.recs[i].x, font.recs[i].y, font.recs[i].width, font.recs[i].height); -@@ -1083,8 +1083,8 @@ bool ExportFontAsCode(Font font, const char *fileName) - #if defined(SUPPORT_FONT_DATA_COPY) - byteCount += sprintf(txtData + byteCount, " // Copy glyph recs data from global fontRecs\n"); - byteCount += sprintf(txtData + byteCount, " // NOTE: Required to avoid issues if trying to free font\n"); -- byteCount += sprintf(txtData + byteCount, " font.recs = (Rectangle *)malloc(font.glyphCount*sizeof(Rectangle));\n"); -- byteCount += sprintf(txtData + byteCount, " memcpy(font.recs, fontRecs_%s, font.glyphCount*sizeof(Rectangle));\n\n", fileNamePascal); -+ byteCount += sprintf(txtData + byteCount, " font.recs = (rlRectangle *)malloc(font.glyphCount*sizeof(rlRectangle));\n"); -+ byteCount += sprintf(txtData + byteCount, " memcpy(font.recs, fontRecs_%s, font.glyphCount*sizeof(rlRectangle));\n\n", fileNamePascal); - - byteCount += sprintf(txtData + byteCount, " // Copy font glyph info data from global fontChars\n"); - byteCount += sprintf(txtData + byteCount, " // NOTE: Required to avoid issues if trying to free font\n"); -@@ -1122,13 +1122,13 @@ void DrawFPS(int posX, int posY) - if ((fps < 30) && (fps >= 15)) color = ORANGE; // Warning FPS - else if (fps < 15) color = RED; // Low FPS - -- DrawText(TextFormat("%2i FPS", fps), posX, posY, 20, color); -+ rlDrawText(TextFormat("%2i FPS", fps), posX, posY, 20, color); - } - - // Draw text (using default font) - // NOTE: fontSize work like in any drawing program but if fontSize is lower than font-base-size, then font-base-size is used - // NOTE: chars spacing is proportional to fontSize --void DrawText(const char *text, int posX, int posY, int fontSize, Color color) -+void rlDrawText(const char *text, int posX, int posY, int fontSize, Color color) - { - // Check if default font has been loaded - if (GetFontDefault().texture.id != 0) -@@ -1139,13 +1139,13 @@ void DrawText(const char *text, int posX, int posY, int fontSize, Color color) - if (fontSize < defaultFontSize) fontSize = defaultFontSize; - int spacing = fontSize/defaultFontSize; - -- DrawTextEx(GetFontDefault(), text, position, (float)fontSize, (float)spacing, color); -+ rlDrawTextEx(GetFontDefault(), text, position, (float)fontSize, (float)spacing, color); - } - } - - // Draw text using Font - // NOTE: chars spacing is NOT proportional to fontSize --void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) -+void rlDrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) - { - if (font.texture.id == 0) font = GetFontDefault(); // Security check in case of not valid font - -@@ -1193,7 +1193,7 @@ void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, - rlRotatef(rotation, 0.0f, 0.0f, 1.0f); - rlTranslatef(-origin.x, -origin.y, 0.0f); - -- DrawTextEx(font, text, (Vector2){ 0.0f, 0.0f }, fontSize, spacing, tint); -+ rlDrawTextEx(font, text, (Vector2){ 0.0f, 0.0f }, fontSize, spacing, tint); - - rlPopMatrix(); - } -@@ -1208,14 +1208,14 @@ void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSiz - - // Character destination rectangle on screen - // NOTE: We consider glyphPadding on drawing -- Rectangle dstRec = { position.x + font.glyphs[index].offsetX*scaleFactor - (float)font.glyphPadding*scaleFactor, -+ rlRectangle dstRec = { position.x + font.glyphs[index].offsetX*scaleFactor - (float)font.glyphPadding*scaleFactor, - position.y + font.glyphs[index].offsetY*scaleFactor - (float)font.glyphPadding*scaleFactor, - (font.recs[index].width + 2.0f*font.glyphPadding)*scaleFactor, - (font.recs[index].height + 2.0f*font.glyphPadding)*scaleFactor }; - - // Character source rectangle from font texture atlas - // NOTE: We consider chars padding when drawing, it could be required for outline/glow shader effects -- Rectangle srcRec = { font.recs[index].x - (float)font.glyphPadding, font.recs[index].y - (float)font.glyphPadding, -+ rlRectangle srcRec = { font.recs[index].x - (float)font.glyphPadding, font.recs[index].y - (float)font.glyphPadding, - font.recs[index].width + 2.0f*font.glyphPadding, font.recs[index].height + 2.0f*font.glyphPadding }; - - // Draw the character texture on the screen -@@ -1376,9 +1376,9 @@ GlyphInfo GetGlyphInfo(Font font, int codepoint) - - // Get glyph rectangle in font atlas for a codepoint (unicode character) - // NOTE: If codepoint is not found in the font it fallbacks to '?' --Rectangle GetGlyphAtlasRec(Font font, int codepoint) -+rlRectangle GetGlyphAtlasRec(Font font, int codepoint) - { -- Rectangle rec = { 0 }; -+ rlRectangle rec = { 0 }; - - rec = font.recs[GetGlyphIndex(font, codepoint)]; - -@@ -2219,7 +2219,7 @@ static Font LoadBMFont(const char *fileName) - - for (int i = 0; i < pageCount; i++) - { -- imFonts[i] = LoadImage(TextFormat("%s/%s", GetDirectoryPath(fileName), imFileName[i])); -+ imFonts[i] = rlLoadImage(TextFormat("%s/%s", GetDirectoryPath(fileName), imFileName[i])); - - if (imFonts[i].format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) - { -@@ -2255,8 +2255,8 @@ static Font LoadBMFont(const char *fileName) - - for (int i = 1; i < pageCount; i++) - { -- Rectangle srcRec = { 0.0f, 0.0f, (float)imWidth, (float)imHeight }; -- Rectangle destRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; -+ rlRectangle srcRec = { 0.0f, 0.0f, (float)imWidth, (float)imHeight }; -+ rlRectangle destRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; - ImageDraw(&fullFont, imFonts[i], srcRec, destRec, WHITE); - } - } -@@ -2270,7 +2270,7 @@ static Font LoadBMFont(const char *fileName) - font.glyphCount = glyphCount; - font.glyphPadding = 0; - font.glyphs = (GlyphInfo *)RL_MALLOC(glyphCount*sizeof(GlyphInfo)); -- font.recs = (Rectangle *)RL_MALLOC(glyphCount*sizeof(Rectangle)); -+ font.recs = (rlRectangle *)RL_MALLOC(glyphCount*sizeof(rlRectangle)); - - int charId, charX, charY, charWidth, charHeight, charOffsetX, charOffsetY, charAdvanceX, pageID; - -@@ -2284,7 +2284,7 @@ static Font LoadBMFont(const char *fileName) - if (readVars == 9) // Make sure all char data has been properly read - { - // Get character rectangle in the font atlas texture -- font.recs[i] = (Rectangle){ (float)charX, (float)charY + (float)imHeight*pageID, (float)charWidth, (float)charHeight }; -+ font.recs[i] = (rlRectangle){ (float)charX, (float)charY + (float)imHeight*pageID, (float)charWidth, (float)charHeight }; - - // Save data properly in sprite font - font.glyphs[i].value = charId; -diff --git a/src/raylib/rtextures.c b/src/raylib/rtextures.c -index ca3ad09..179009b 100644 ---- a/src/raylib/rtextures.c -+++ b/src/raylib/rtextures.c -@@ -263,7 +263,7 @@ static Vector4 *LoadImageDataNormalized(Image image); // Load pixel data f - //---------------------------------------------------------------------------------- - - // Load image from file into CPU memory (RAM) --Image LoadImage(const char *fileName) -+Image rlLoadImage(const char *fileName) - { - Image image = { 0 }; - -@@ -361,7 +361,7 @@ Image LoadImageAnim(const char *fileName, int *frames) - #endif - else - { -- image = LoadImage(fileName); -+ image = rlLoadImage(fileName); - frameCount = 1; - } - -@@ -1167,7 +1167,7 @@ Image ImageCopy(Image image) - } - - // Create an image from another image piece --Image ImageFromImage(Image image, Rectangle rec) -+Image ImageFromImage(Image image, rlRectangle rec) - { - Image result = { 0 }; - -@@ -1189,7 +1189,7 @@ Image ImageFromImage(Image image, Rectangle rec) - - // Crop an image to area defined by a rectangle - // NOTE: Security checks are performed in case rectangle goes out of bounds --void ImageCrop(Image *image, Rectangle crop) -+void ImageCrop(Image *image, rlRectangle crop) - { - // Security check to avoid program crash - if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; -@@ -1499,8 +1499,8 @@ Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Co - { - if ((codepoint != ' ') && (codepoint != '\t')) - { -- Rectangle rec = { (float)(textOffsetX + font.glyphs[index].offsetX), (float)(textOffsetY + font.glyphs[index].offsetY), (float)font.recs[index].width, (float)font.recs[index].height }; -- ImageDraw(&imText, font.glyphs[index].image, (Rectangle){ 0, 0, (float)font.glyphs[index].image.width, (float)font.glyphs[index].image.height }, rec, tint); -+ rlRectangle rec = { (float)(textOffsetX + font.glyphs[index].offsetX), (float)(textOffsetY + font.glyphs[index].offsetY), (float)font.recs[index].width, (float)font.recs[index].height }; -+ ImageDraw(&imText, font.glyphs[index].image, (rlRectangle){ 0, 0, (float)font.glyphs[index].image.width, (float)font.glyphs[index].image.height }, rec, tint); - } - - if (font.glyphs[index].advanceX == 0) textOffsetX += (int)(font.recs[index].width + spacing); -@@ -1802,7 +1802,7 @@ void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, i - if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); - else if ((newWidth != image->width) || (newHeight != image->height)) - { -- Rectangle srcRec = { 0, 0, (float)image->width, (float)image->height }; -+ rlRectangle srcRec = { 0, 0, (float)image->width, (float)image->height }; - Vector2 dstPos = { (float)offsetX, (float)offsetY }; - - if (offsetX < 0) -@@ -1882,7 +1882,7 @@ void ImageAlphaCrop(Image *image, float threshold) - // Security check to avoid program crash - if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; - -- Rectangle crop = GetImageAlphaBorder(*image, threshold); -+ rlRectangle crop = GetImageAlphaBorder(*image, threshold); - - // Crop if rectangle is valid - if (((int)crop.width != 0) && ((int)crop.height != 0)) ImageCrop(image, crop); -@@ -3134,9 +3134,9 @@ void UnloadImagePalette(Color *colors) - - // Get image alpha border rectangle - // NOTE: Threshold is defined as a percentage: 0.0f -> 1.0f --Rectangle GetImageAlphaBorder(Image image, float threshold) -+rlRectangle GetImageAlphaBorder(Image image, float threshold) - { -- Rectangle crop = { 0 }; -+ rlRectangle crop = { 0 }; - - Color *pixels = LoadImageColors(image); - -@@ -3164,7 +3164,7 @@ Rectangle GetImageAlphaBorder(Image image, float threshold) - // Check for empty blank image - if ((xMin != 65536) && (xMax != 65536)) - { -- crop = (Rectangle){ (float)xMin, (float)yMin, (float)((xMax + 1) - xMin), (float)((yMax + 1) - yMin) }; -+ crop = (rlRectangle){ (float)xMin, (float)yMin, (float)((xMax + 1) - xMin), (float)((yMax + 1) - yMin) }; - } - - UnloadImageColors(pixels); -@@ -3647,7 +3647,7 @@ void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) - // Draw rectangle within an image - void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color) - { -- ImageDrawRectangleRec(dst, (Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color); -+ ImageDrawRectangleRec(dst, (rlRectangle){ (float)posX, (float)posY, (float)width, (float)height }, color); - } - - // Draw rectangle within an image (Vector version) -@@ -3657,7 +3657,7 @@ void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color - } - - // Draw rectangle within an image --void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) -+void ImageDrawRectangleRec(Image *dst, rlRectangle rec, Color color) - { - // Security check to avoid program crash - if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0)) return; -@@ -3702,7 +3702,7 @@ void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) - } - - // Draw rectangle lines within an image --void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color) -+void ImageDrawRectangleLines(Image *dst, rlRectangle rec, int thick, Color color) - { - ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color); - ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + thick), thick, (int)(rec.height - thick*2), color); -@@ -3900,7 +3900,7 @@ void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color c - - // Draw an image (source) within an image (destination) - // NOTE: Color tint is applied to source image --void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint) -+void ImageDraw(Image *dst, Image src, rlRectangle srcRec, rlRectangle dstRec, Color tint) - { - // Security check to avoid program crash - if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0) || -@@ -3926,7 +3926,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color - { - srcMod = ImageFromImage(src, srcRec); // Create image from another image - ImageResize(&srcMod, (int)dstRec.width, (int)dstRec.height); // Resize to destination rectangle -- srcRec = (Rectangle){ 0, 0, (float)srcMod.width, (float)srcMod.height }; -+ srcRec = (rlRectangle){ 0, 0, (float)srcMod.width, (float)srcMod.height }; - - srcPtr = &srcMod; - useSrcMod = true; -@@ -4041,8 +4041,8 @@ void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, - { - Image imText = ImageTextEx(font, text, fontSize, spacing, tint); - -- Rectangle srcRec = { 0.0f, 0.0f, (float)imText.width, (float)imText.height }; -- Rectangle dstRec = { position.x, position.y, (float)imText.width, (float)imText.height }; -+ rlRectangle srcRec = { 0.0f, 0.0f, (float)imText.width, (float)imText.height }; -+ rlRectangle dstRec = { position.x, position.y, (float)imText.width, (float)imText.height }; - - ImageDraw(dst, imText, srcRec, dstRec, WHITE); - -@@ -4057,7 +4057,7 @@ Texture2D LoadTexture(const char *fileName) - { - Texture2D texture = { 0 }; - -- Image image = LoadImage(fileName); -+ Image image = rlLoadImage(fileName); - - if (image.data != NULL) - { -@@ -4123,9 +4123,9 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) - int size = cubemap.width; - - Image faces = { 0 }; // Vertical column image -- Rectangle faceRecs[6] = { 0 }; // Face source rectangles -+ rlRectangle faceRecs[6] = { 0 }; // Face source rectangles - -- for (int i = 0; i < 6; i++) faceRecs[i] = (Rectangle){ 0, 0, (float)size, (float)size }; -+ for (int i = 0; i < 6; i++) faceRecs[i] = (rlRectangle){ 0, 0, (float)size, (float)size }; - - if (layout == CUBEMAP_LAYOUT_LINE_VERTICAL) - { -@@ -4164,7 +4164,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) - - // NOTE: Image formatting does not work with compressed textures - -- for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE); -+ for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (rlRectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE); - } - - // NOTE: Cubemap data is expected to be provided as 6 images in a single data array, -@@ -4290,7 +4290,7 @@ void UpdateTexture(Texture2D texture, const void *pixels) - - // Update GPU texture rectangle with new data - // NOTE: pixels data must match texture.format --void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels) -+void UpdateTextureRec(Texture2D texture, rlRectangle rec, const void *pixels) - { - rlUpdateTexture(texture.id, (int)rec.x, (int)rec.y, (int)rec.width, (int)rec.height, texture.format, pixels); - } -@@ -4420,17 +4420,17 @@ void DrawTextureV(Texture2D texture, Vector2 position, Color tint) - // Draw a texture with extended parameters - void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) - { -- Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; -- Rectangle dest = { position.x, position.y, (float)texture.width*scale, (float)texture.height*scale }; -+ rlRectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; -+ rlRectangle dest = { position.x, position.y, (float)texture.width*scale, (float)texture.height*scale }; - Vector2 origin = { 0.0f, 0.0f }; - - DrawTexturePro(texture, source, dest, origin, rotation, tint); - } - - // Draw a part of a texture (defined by a rectangle) --void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint) -+void DrawTextureRec(Texture2D texture, rlRectangle source, Vector2 position, Color tint) - { -- Rectangle dest = { position.x, position.y, fabsf(source.width), fabsf(source.height) }; -+ rlRectangle dest = { position.x, position.y, fabsf(source.width), fabsf(source.height) }; - Vector2 origin = { 0.0f, 0.0f }; - - DrawTexturePro(texture, source, dest, origin, 0.0f, tint); -@@ -4438,7 +4438,7 @@ void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color - - // Draw a part of a texture (defined by a rectangle) with 'pro' parameters - // NOTE: origin is relative to destination rectangle size --void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint) -+void DrawTexturePro(Texture2D texture, rlRectangle source, rlRectangle dest, Vector2 origin, float rotation, Color tint) - { - // Check if texture is valid - if (texture.id > 0) -@@ -4563,7 +4563,7 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 - } - - // Draws a texture (or part of it) that stretches or shrinks nicely using n-patch info --void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint) -+void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, rlRectangle dest, Vector2 origin, float rotation, Color tint) - { - if (texture.id > 0) - { --- -2.47.0 - diff --git a/src/raylib.nim b/src/raylib.nim index acc54cd..73b1100 100644 --- a/src/raylib.nim +++ b/src/raylib.nim @@ -108,6 +108,7 @@ else: # pkg-config x11 xrandr xinerama xi xcursor --libs {.passL: "-lX11 -lXrandr -lXinerama -lXi -lXcursor".} +# {.compile: raylibDir / Path"naylib.c".} when defined(emscripten): discard elif defined(android): discard elif defined(macosx): {.compile(raylibDir / Path"rglfw.c", "-x objective-c").} @@ -491,59 +492,59 @@ template MapDiffuse*(_: typedesc[ShaderLocationIndex]): untyped = MapAlbedo template MapSpecular*(_: typedesc[ShaderLocationIndex]): untyped = MapMetalness type - Vector2* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Vector2, 2 components + Vector2* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Vector2, 2 components x*: float32 ## Vector x component y*: float32 ## Vector y component - Vector3* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Vector3, 3 components + Vector3* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Vector3, 3 components x*: float32 ## Vector x component y*: float32 ## Vector y component z*: float32 ## Vector z component - Vector4* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Vector4, 4 components + Vector4* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Vector4, 4 components x*: float32 ## Vector x component y*: float32 ## Vector y component z*: float32 ## Vector z component w*: float32 ## Vector w component - Matrix* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Matrix, 4x4 components, column major, OpenGL style, right-handed + Matrix* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Matrix, 4x4 components, column major, OpenGL style, right-handed m0*, m4*, m8*, m12*: float32 ## Matrix first row (4 components) m1*, m5*, m9*, m13*: float32 ## Matrix second row (4 components) m2*, m6*, m10*, m14*: float32 ## Matrix third row (4 components) m3*, m7*, m11*, m15*: float32 ## Matrix fourth row (4 components) - Color* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Color, 4 components, R8G8B8A8 (32bit) + Color* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Color, 4 components, R8G8B8A8 (32bit) r*: uint8 ## Color red value g*: uint8 ## Color green value b*: uint8 ## Color blue value a*: uint8 ## Color alpha value - Rectangle* {.importc: "rlRectangle", header: "raylib.h", completeStruct, bycopy.} = object ## Rectangle, 4 components + Rectangle* {.importc: "Rectangle", header: "naylib.h", completeStruct, bycopy.} = object ## Rectangle, 4 components x*: float32 ## Rectangle top-left corner position x y*: float32 ## Rectangle top-left corner position y width*: float32 ## Rectangle width height*: float32 ## Rectangle height - Image* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Image, pixel data stored in CPU memory (RAM) + Image* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Image, pixel data stored in CPU memory (RAM) data*: pointer ## Image raw data width*: int32 ## Image base width height*: int32 ## Image base height mipmaps*: int32 ## Mipmap levels, 1 by default format*: PixelFormat ## Data format (PixelFormat type) - Texture* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Texture, tex data stored in GPU memory (VRAM) + Texture* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Texture, tex data stored in GPU memory (VRAM) id*: uint32 ## OpenGL texture id width*: int32 ## Texture base width height*: int32 ## Texture base height mipmaps*: int32 ## Mipmap levels, 1 by default format*: PixelFormat ## Data format (PixelFormat type) - RenderTexture* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## RenderTexture, fbo for texture rendering + RenderTexture* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## RenderTexture, fbo for texture rendering id*: uint32 ## OpenGL framebuffer object id texture*: Texture ## Color buffer attachment texture depth*: Texture ## Depth buffer attachment texture - NPatchInfo* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## NPatchInfo, n-patch layout info + NPatchInfo* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## NPatchInfo, n-patch layout info source*: Rectangle ## Texture source rectangle left*: int32 ## Left border offset top*: int32 ## Top border offset @@ -551,14 +552,14 @@ type bottom*: int32 ## Bottom border offset layout*: NPatchLayout ## Layout of the n-patch: 3x3, 1x3 or 3x1 - GlyphInfo* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## GlyphInfo, font characters glyphs info + GlyphInfo* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## GlyphInfo, font characters glyphs info value*: int32 ## Character value (Unicode) offsetX*: int32 ## Character offset X when drawing offsetY*: int32 ## Character offset Y when drawing advanceX*: int32 ## Character advance position X image*: Image ## Character image data - Font* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Font, font texture and GlyphInfo array data + Font* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Font, font texture and GlyphInfo array data baseSize*: int32 ## Base size (default chars height) glyphCount: int32 ## Number of glyph characters glyphPadding*: int32 ## Padding around the glyph characters @@ -566,20 +567,20 @@ type recs: ptr UncheckedArray[Rectangle] ## Rectangles in texture for the glyphs glyphs: ptr UncheckedArray[GlyphInfo] ## Glyphs info data - Camera3D* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Camera, defines position/orientation in 3d space + Camera3D* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Camera, defines position/orientation in 3d space position*: Vector3 ## Camera position target*: Vector3 ## Camera target it looks-at up*: Vector3 ## Camera up vector (rotation over its axis) fovy*: float32 ## Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic projection*: CameraProjection ## Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC - Camera2D* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Camera2D, defines position/orientation in 2d space + Camera2D* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Camera2D, defines position/orientation in 2d space offset*: Vector2 ## Camera offset (displacement from target) target*: Vector2 ## Camera target (rotation and zoom origin) rotation*: float32 ## Camera rotation in degrees zoom*: float32 ## Camera zoom (scaling), should be 1.0f by default - Mesh* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Mesh, vertex data and vao/vbo + Mesh* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Mesh, vertex data and vao/vbo vertexCount: int32 ## Number of vertices stored in arrays triangleCount: int32 ## Number of triangles stored (indexed or not) vertices: ptr UncheckedArray[float32] ## Vertex position (XYZ - 3 components per vertex) (shader-location = 0) @@ -598,30 +599,30 @@ type vaoId*: uint32 ## OpenGL Vertex Array Object id vboId: ptr UncheckedArray[uint32] ## OpenGL Vertex Buffer Objects id (default vertex data) - Shader* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Shader + Shader* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Shader id*: uint32 ## Shader program id locs: ptr UncheckedArray[ShaderLocation] ## Shader locations array (RL_MAX_SHADER_LOCATIONS) - MaterialMap* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## MaterialMap + MaterialMap* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## MaterialMap texture: Texture2D ## Material map texture color*: Color ## Material map color value*: float32 ## Material map value - Material* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Material, includes shader and maps + Material* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Material, includes shader and maps shader: Shader ## Material shader maps: ptr UncheckedArray[MaterialMap] ## Material maps array (MAX_MATERIAL_MAPS) params*: array[4, float32] ## Material generic parameters (if required) - Transform* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Transform, vertex transformation data + Transform* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Transform, vertex transformation data translation*: Vector3 ## Translation rotation*: Quaternion ## Rotation scale*: Vector3 ## Scale - BoneInfo* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Bone, skeletal animation bone + BoneInfo* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Bone, skeletal animation bone name*: array[32, char] ## Bone name parent*: int32 ## Bone parent - Model* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Model, meshes, materials and animation data + Model* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Model, meshes, materials and animation data transform*: Matrix ## Local transform matrix meshCount: int32 ## Number of meshes materialCount: int32 ## Number of materials @@ -632,53 +633,53 @@ type bones: ptr UncheckedArray[BoneInfo] ## Bones information (skeleton) bindPose: ptr UncheckedArray[Transform] ## Bones base transformation (pose) - ModelAnimation* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## ModelAnimation + ModelAnimation* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## ModelAnimation boneCount: int32 ## Number of bones frameCount: int32 ## Number of animation frames bones: ptr UncheckedArray[BoneInfo] ## Bones information (skeleton) framePoses: ptr UncheckedArray[ptr UncheckedArray[Transform]] ## Poses array by frame name*: array[32, char] ## Animation name - Ray* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Ray, ray for raycasting + Ray* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Ray, ray for raycasting position*: Vector3 ## Ray position (origin) direction*: Vector3 ## Ray direction (normalized) - RayCollision* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## RayCollision, ray hit information + RayCollision* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## RayCollision, ray hit information hit*: bool ## Did the ray hit something? distance*: float32 ## Distance to the nearest hit point*: Vector3 ## Point of the nearest hit normal*: Vector3 ## Surface normal of hit - BoundingBox* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## BoundingBox + BoundingBox* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## BoundingBox min*: Vector3 ## Minimum vertex box-corner max*: Vector3 ## Maximum vertex box-corner - Wave* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Wave, audio wave data + Wave* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Wave, audio wave data frameCount*: uint32 ## Total number of frames (considering channels) sampleRate*: uint32 ## Frequency (samples per second) sampleSize*: uint32 ## Bit depth (bits per sample): 8, 16, 32 (24 not supported) channels*: uint32 ## Number of channels (1-mono, 2-stereo, ...) data*: pointer ## Buffer data pointer - AudioStream* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## AudioStream, custom audio stream + AudioStream* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## AudioStream, custom audio stream buffer: ptr rAudioBuffer ## Pointer to internal data used by the audio system processor: ptr rAudioProcessor ## Pointer to internal data processor, useful for audio effects sampleRate*: uint32 ## Frequency (samples per second) sampleSize*: uint32 ## Bit depth (bits per sample): 8, 16, 32 (24 not supported) channels*: uint32 ## Number of channels (1-mono, 2-stereo, ...) - Sound* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Sound + Sound* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Sound stream*: AudioStream ## Audio stream frameCount*: uint32 ## Total number of frames (considering channels) - Music* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Music, audio stream, anything longer than ~10 seconds should be streamed + Music* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Music, audio stream, anything longer than ~10 seconds should be streamed stream*: AudioStream ## Audio stream frameCount*: uint32 ## Total number of frames (considering channels) looping*: bool ## Music looping enable ctxType*: int32 ## Type of music context (audio filetype) ctxData*: pointer ## Audio context data, depends on type - VrDeviceInfo* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## VrDeviceInfo, Head-Mounted-Display device parameters + VrDeviceInfo* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## VrDeviceInfo, Head-Mounted-Display device parameters hResolution*: int32 ## Horizontal resolution in pixels vResolution*: int32 ## Vertical resolution in pixels hScreenSize*: float32 ## Horizontal size in meters @@ -689,7 +690,7 @@ type lensDistortionValues*: array[4, float32] ## Lens distortion constant parameters chromaAbCorrection*: array[4, float32] ## Chromatic aberration correction parameters - VrStereoConfig* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## VrStereoConfig, VR stereo rendering configuration for simulator + VrStereoConfig* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## VrStereoConfig, VR stereo rendering configuration for simulator projection*: array[2, Matrix] ## VR projection matrices (per eye) viewOffset*: array[2, Matrix] ## VR view offset matrices (per eye) leftLensCenter*: array[2, float32] ## VR left lens center @@ -699,17 +700,17 @@ type scale*: array[2, float32] ## VR distortion scale scaleIn*: array[2, float32] ## VR distortion scale in - FilePathList {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## File path list + FilePathList {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## File path list capacity: uint32 ## Filepaths max entries count: uint32 ## Filepaths entries count paths: cstringArray ## Filepaths entries - AutomationEvent* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Automation event + AutomationEvent* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Automation event frame*: uint32 ## Event frame `type`*: uint32 ## Event type (AutomationEventType) params*: array[4, int32] ## Event parameters (if required) - AutomationEventList* {.importc, header: "raylib.h", completeStruct, bycopy.} = object ## Automation event list + AutomationEventList* {.importc, header: "naylib.h", completeStruct, bycopy.} = object ## Automation event list capacity: uint32 ## Events max entries (MAX_AUTOMATION_EVENTS) count: uint32 ## Events entries count events: ptr UncheckedArray[AutomationEvent] ## Events entries @@ -794,9 +795,9 @@ const Magenta* = Color(r: 255, g: 0, b: 255, a: 255) RayWhite* = Color(r: 245, g: 245, b: 245, a: 255) -{.push callconv: cdecl, header: "raylib.h".} +{.push callconv: cdecl, header: "naylib.h".} proc initWindowImpl(width: int32, height: int32, title: cstring) {.importc: "InitWindow", sideEffect.} -proc closeWindow*() {.importc: "rlCloseWindow", sideEffect.} +proc closeWindow*() {.importc: "CloseWindow", sideEffect.} ## Close window and unload OpenGL context proc windowShouldClose*(): bool {.importc: "WindowShouldClose", sideEffect.} ## Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) @@ -885,7 +886,7 @@ proc enableEventWaiting*() {.importc: "EnableEventWaiting", sideEffect.} ## Enable waiting for events on EndDrawing(), no automatic event polling proc disableEventWaiting*() {.importc: "DisableEventWaiting", sideEffect.} ## Disable waiting for events on EndDrawing(), automatic events polling -proc showCursor*() {.importc: "rlShowCursor", sideEffect.} +proc showCursor*() {.importc: "ShowCursor", sideEffect.} ## Shows cursor proc hideCursor*() {.importc: "HideCursor", sideEffect.} ## Hides cursor @@ -1231,7 +1232,7 @@ func checkCollisionLines*(startPos1: Vector2, endPos1: Vector2, startPos2: Vecto ## Check the collision between two lines defined by two points each, returns collision point by reference func getCollisionRec*(rec1: Rectangle, rec2: Rectangle): Rectangle {.importc: "GetCollisionRec".} ## Get collision rectangle for two rectangles collision -proc loadImageImpl(fileName: cstring): Image {.importc: "rlLoadImage", sideEffect.} +proc loadImageImpl(fileName: cstring): Image {.importc: "LoadImage", sideEffect.} proc loadImageRawImpl(fileName: cstring, width: int32, height: int32, format: PixelFormat, headerSize: int32): Image {.importc: "LoadImageRaw", sideEffect.} proc loadImageAnimImpl(fileName: cstring, frames: out int32): Image {.importc: "LoadImageAnim", sideEffect.} proc loadImageAnimFromMemoryImpl(fileType: cstring, fileData: ptr UncheckedArray[uint8], dataSize: int32, frames: ptr UncheckedArray[int32]): Image {.importc: "LoadImageAnimFromMemory", sideEffect.} @@ -1433,8 +1434,8 @@ proc unloadFont(font: Font) {.importc: "UnloadFont", sideEffect.} proc exportFontAsCodeImpl(font: Font, fileName: cstring): bool {.importc: "ExportFontAsCode", sideEffect.} proc drawFPS*(posX: int32, posY: int32) {.importc: "DrawFPS", sideEffect.} ## Draw current FPS -proc drawTextImpl(text: cstring, posX: int32, posY: int32, fontSize: int32, color: Color) {.importc: "rlDrawText", sideEffect.} -proc drawTextImpl(font: Font, text: cstring, position: Vector2, fontSize: float32, spacing: float32, tint: Color) {.importc: "rlDrawTextEx", sideEffect.} +proc drawTextImpl(text: cstring, posX: int32, posY: int32, fontSize: int32, color: Color) {.importc: "DrawText", sideEffect.} +proc drawTextImpl(font: Font, text: cstring, position: Vector2, fontSize: float32, spacing: float32, tint: Color) {.importc: "DrawTextEx", sideEffect.} proc drawTextImpl(font: Font, text: cstring, position: Vector2, origin: Vector2, rotation: float32, fontSize: float32, spacing: float32, tint: Color) {.importc: "DrawTextPro", sideEffect.} proc drawTextCodepoint*(font: Font, codepoint: Rune, position: Vector2, fontSize: float32, tint: Color) {.importc: "DrawTextCodepoint", sideEffect.} ## Draw one character (codepoint) diff --git a/src/raylib/external/jar_xm.h b/src/raylib/external/jar_xm.h index 5459410..b5e80e4 100644 --- a/src/raylib/external/jar_xm.h +++ b/src/raylib/external/jar_xm.h @@ -2373,23 +2373,23 @@ void jar_xm_debug(jar_xm_context_t *ctx) { int x = 0, y = 0; // DEBUG VARIABLES - y += size; rlDrawText(TextFormat("CUR TBL = %i", ctx->current_table_index), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("CUR PAT = %i", ctx->module.pattern_table[ctx->current_table_index]), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("POS JMP = %d", ctx->position_jump), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("JMP DST = %i", ctx->jump_dest), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("PTN BRK = %d", ctx->pattern_break), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("CUR ROW = %i", ctx->current_row), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("JMP ROW = %i", ctx->jump_row), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("ROW LCT = %i", ctx->row_loop_count), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("LCT = %i", ctx->loop_count), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("MAX LCT = %i", ctx->max_loop_count), x, y, size, WHITE); + y += size; DrawText(TextFormat("CUR TBL = %i", ctx->current_table_index), x, y, size, WHITE); + y += size; DrawText(TextFormat("CUR PAT = %i", ctx->module.pattern_table[ctx->current_table_index]), x, y, size, WHITE); + y += size; DrawText(TextFormat("POS JMP = %d", ctx->position_jump), x, y, size, WHITE); + y += size; DrawText(TextFormat("JMP DST = %i", ctx->jump_dest), x, y, size, WHITE); + y += size; DrawText(TextFormat("PTN BRK = %d", ctx->pattern_break), x, y, size, WHITE); + y += size; DrawText(TextFormat("CUR ROW = %i", ctx->current_row), x, y, size, WHITE); + y += size; DrawText(TextFormat("JMP ROW = %i", ctx->jump_row), x, y, size, WHITE); + y += size; DrawText(TextFormat("ROW LCT = %i", ctx->row_loop_count), x, y, size, WHITE); + y += size; DrawText(TextFormat("LCT = %i", ctx->loop_count), x, y, size, WHITE); + y += size; DrawText(TextFormat("MAX LCT = %i", ctx->max_loop_count), x, y, size, WHITE); x = size * 12; y = 0; - y += size; rlDrawText(TextFormat("CUR TCK = %i", ctx->current_tick), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("XTR TCK = %i", ctx->extra_ticks), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("TCK/ROW = %i", ctx->tempo), x, y, size, ORANGE); - y += size; rlDrawText(TextFormat("SPL TCK = %f", ctx->remaining_samples_in_tick), x, y, size, WHITE); - y += size; rlDrawText(TextFormat("GEN SPL = %i", ctx->generated_samples), x, y, size, WHITE); + y += size; DrawText(TextFormat("CUR TCK = %i", ctx->current_tick), x, y, size, WHITE); + y += size; DrawText(TextFormat("XTR TCK = %i", ctx->extra_ticks), x, y, size, WHITE); + y += size; DrawText(TextFormat("TCK/ROW = %i", ctx->tempo), x, y, size, ORANGE); + y += size; DrawText(TextFormat("SPL TCK = %f", ctx->remaining_samples_in_tick), x, y, size, WHITE); + y += size; DrawText(TextFormat("GEN SPL = %i", ctx->generated_samples), x, y, size, WHITE); y += size * 7; x = 0; @@ -2404,13 +2404,13 @@ void jar_xm_debug(jar_xm_context_t *ctx) { }; }; if (i == ctx->current_table_index) { -// rlDrawText(TextFormat("%02X", ctx->current_tick), i * size * 2, y - size, size, WHITE); +// DrawText(TextFormat("%02X", ctx->current_tick), i * size * 2, y - size, size, WHITE); DrawRectangle(i * size * 2, y, size * 2, size, RED); - rlDrawText(TextFormat("%02X", ctx->current_row), i * size * 2, y - size, size, YELLOW); + DrawText(TextFormat("%02X", ctx->current_row), i * size * 2, y - size, size, YELLOW); } else { DrawRectangle(i * size * 2, y, size * 2, size, ORANGE); }; - rlDrawText(TextFormat("%02X", ctx->module.pattern_table[i]), i * size * 2, y, size, WHITE); + DrawText(TextFormat("%02X", ctx->module.pattern_table[i]), i * size * 2, y, size, WHITE); }; y += size; @@ -2421,10 +2421,10 @@ void jar_xm_debug(jar_xm_context_t *ctx) { x += 2 * size; for(uint8_t i = 0; i < ctx->module.num_channels; i++) { DrawRectangle(x, y, 8 * size, size, PURPLE); - rlDrawText("N", x, y, size, YELLOW); - rlDrawText("I", x + size * 2, y, size, YELLOW); - rlDrawText("V", x + size * 4, y, size, YELLOW); - rlDrawText("FX", x + size * 6, y, size, YELLOW); + DrawText("N", x, y, size, YELLOW); + DrawText("I", x + size * 2, y, size, YELLOW); + DrawText("V", x + size * 4, y, size, YELLOW); + DrawText("FX", x + size * 6, y, size, YELLOW); x += 9 * size; }; x += size; @@ -2433,7 +2433,7 @@ void jar_xm_debug(jar_xm_context_t *ctx) { x = 0; if (j >=0 && j < (cur->num_rows)) { DrawRectangle(x, y, size * 2, size, BROWN); - rlDrawText(TextFormat("%02X",j), x, y, size, WHITE); + DrawText(TextFormat("%02X",j), x, y, size, WHITE); x += 2 * size; for(uint8_t i = 0; i < ctx->module.num_channels; i++) { if (j==(ctx->current_row)) { @@ -2443,20 +2443,20 @@ void jar_xm_debug(jar_xm_context_t *ctx) { }; jar_xm_pattern_slot_t *s = cur->slots + j * ctx->module.num_channels + i; // jar_xm_channel_context_t *ch = ctx->channels + i; - if (s->note > 0) {rlDrawText(TextFormat("%s%s", xm_note_chr(s->note), xm_octave_chr(s->note) ), x, y, size, WHITE);} else {rlDrawText("...", x, y, size, GRAY);}; + if (s->note > 0) {DrawText(TextFormat("%s%s", xm_note_chr(s->note), xm_octave_chr(s->note) ), x, y, size, WHITE);} else {DrawText("...", x, y, size, GRAY);}; if (s->instrument > 0) { - rlDrawText(TextFormat("%02X", s->instrument), x + size * 2, y, size, WHITE); + DrawText(TextFormat("%02X", s->instrument), x + size * 2, y, size, WHITE); if (s->volume_column == 0) { - rlDrawText(TextFormat("%02X", 64), x + size * 4, y, size, YELLOW); + DrawText(TextFormat("%02X", 64), x + size * 4, y, size, YELLOW); }; } else { - rlDrawText("..", x + size * 2, y, size, GRAY); + DrawText("..", x + size * 2, y, size, GRAY); if (s->volume_column == 0) { - rlDrawText("..", x + size * 4, y, size, GRAY); + DrawText("..", x + size * 4, y, size, GRAY); }; }; - if (s->volume_column > 0) {rlDrawText(TextFormat("%02X", (s->volume_column - 16)), x + size * 4, y, size, WHITE);}; - if (s->effect_type > 0 || s->effect_param > 0) {rlDrawText(TextFormat("%s%02X", xm_effect_chr(s->effect_type), s->effect_param), x + size * 6, y, size, WHITE);}; + if (s->volume_column > 0) {DrawText(TextFormat("%02X", (s->volume_column - 16)), x + size * 4, y, size, WHITE);}; + if (s->effect_type > 0 || s->effect_param > 0) {DrawText(TextFormat("%s%02X", xm_effect_chr(s->effect_type), s->effect_param), x + size * 6, y, size, WHITE);}; x += 9 * size; }; }; diff --git a/src/raylib/naylib.h b/src/raylib/naylib.h new file mode 100644 index 0000000..b74c35e --- /dev/null +++ b/src/raylib/naylib.h @@ -0,0 +1,3 @@ +#define NOGDI +#define NOUSER +#include "raylib.h" diff --git a/src/raylib/platforms/rcore_android.c b/src/raylib/platforms/rcore_android.c index d42d07e..85ce82a 100644 --- a/src/raylib/platforms/rcore_android.c +++ b/src/raylib/platforms/rcore_android.c @@ -516,7 +516,7 @@ const char *GetClipboardText(void) } // Show mouse cursor -void rlShowCursor(void) +void ShowCursor(void) { CORE.Input.Mouse.cursorHidden = false; } @@ -1004,16 +1004,16 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) #if defined(SUPPORT_MODULE_RSHAPES) // Set font white rectangle for shapes drawing, so shapes and text can be batched together // WARNING: rshapes module is required, if not available, default internal white rectangle is used - rlRectangle rec = GetFontDefault().recs[95]; + Rectangle rec = GetFontDefault().recs[95]; if (CORE.Window.flags & FLAG_MSAA_4X_HINT) { // NOTE: We try to maxime rec padding to avoid pixel bleeding on MSAA filtering - SetShapesTexture(GetFontDefault().texture, (rlRectangle){ rec.x + 2, rec.y + 2, 1, 1 }); + SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 2, rec.y + 2, 1, 1 }); } else { // NOTE: We set up a 1px padding on char rectangle to avoid pixel bleeding - SetShapesTexture(GetFontDefault().texture, (rlRectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); + SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); } #endif #else @@ -1021,7 +1021,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) // Set default texture and rectangle to be used for shapes drawing // NOTE: rlgl default texture is a 1x1 pixel UNCOMPRESSED_R8G8B8A8 Texture2D texture = { rlGetTextureIdDefault(), 1, 1, 1, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 }; - SetShapesTexture(texture, (rlRectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); // WARNING: Module required: rshapes + SetShapesTexture(texture, (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); // WARNING: Module required: rshapes #endif #endif diff --git a/src/raylib/platforms/rcore_desktop_glfw.c b/src/raylib/platforms/rcore_desktop_glfw.c index 852b59b..41f7fac 100644 --- a/src/raylib/platforms/rcore_desktop_glfw.c +++ b/src/raylib/platforms/rcore_desktop_glfw.c @@ -966,7 +966,7 @@ const char *GetClipboardText(void) } // Show mouse cursor -void rlShowCursor(void) +void ShowCursor(void) { glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_NORMAL); CORE.Input.Mouse.cursorHidden = false; diff --git a/src/raylib/platforms/rcore_desktop_sdl.c b/src/raylib/platforms/rcore_desktop_sdl.c index fd57ad2..7cbe035 100644 --- a/src/raylib/platforms/rcore_desktop_sdl.c +++ b/src/raylib/platforms/rcore_desktop_sdl.c @@ -878,7 +878,7 @@ const char *GetClipboardText(void) } // Show mouse cursor -void rlShowCursor(void) +void ShowCursor(void) { SDL_ShowCursor(SDL_ENABLE); diff --git a/src/raylib/platforms/rcore_drm.c b/src/raylib/platforms/rcore_drm.c index 18a5d69..eb8ef01 100644 --- a/src/raylib/platforms/rcore_drm.c +++ b/src/raylib/platforms/rcore_drm.c @@ -119,7 +119,7 @@ typedef struct { char currentButtonStateEvdev[MAX_MOUSE_BUTTONS]; // Holds the new mouse state for the next polling event to grab bool cursorRelative; // Relative cursor mode int mouseFd; // File descriptor for the evdev mouse/touch/gestures - rlRectangle absRange; // Range of values for absolute pointing devices (touchscreens) + Rectangle absRange; // Range of values for absolute pointing devices (touchscreens) int touchSlot; // Hold the touch slot number of the currently being sent multitouch block // Gamepad data @@ -510,7 +510,7 @@ const char *GetClipboardText(void) } // Show mouse cursor -void rlShowCursor(void) +void ShowCursor(void) { CORE.Input.Mouse.cursorHidden = false; } diff --git a/src/raylib/platforms/rcore_template.c b/src/raylib/platforms/rcore_template.c index 1f8c116..6bc3432 100644 --- a/src/raylib/platforms/rcore_template.c +++ b/src/raylib/platforms/rcore_template.c @@ -293,7 +293,7 @@ const char *GetClipboardText(void) } // Show mouse cursor -void rlShowCursor(void) +void ShowCursor(void) { CORE.Input.Mouse.cursorHidden = false; } diff --git a/src/raylib/platforms/rcore_web.c b/src/raylib/platforms/rcore_web.c index 0138c61..e15d3f5 100644 --- a/src/raylib/platforms/rcore_web.c +++ b/src/raylib/platforms/rcore_web.c @@ -806,7 +806,7 @@ const char *GetClipboardText(void) } // Show mouse cursor -void rlShowCursor(void) +void ShowCursor(void) { if (CORE.Input.Mouse.cursorHidden) { diff --git a/src/raylib/raylib.h b/src/raylib/raylib.h index 38e2d56..c9d9f6e 100644 --- a/src/raylib/raylib.h +++ b/src/raylib/raylib.h @@ -252,12 +252,12 @@ typedef struct Color { } Color; // Rectangle, 4 components -typedef struct rlRectangle { +typedef struct Rectangle { float x; // Rectangle top-left corner position x float y; // Rectangle top-left corner position y float width; // Rectangle width float height; // Rectangle height -} rlRectangle; +} Rectangle; // Image, pixel data stored in CPU memory (RAM) typedef struct Image { @@ -295,7 +295,7 @@ typedef RenderTexture RenderTexture2D; // NPatchInfo, n-patch layout info typedef struct NPatchInfo { - rlRectangle source; // Texture source rectangle + Rectangle source; // Texture source rectangle int left; // Left border offset int top; // Top border offset int right; // Right border offset @@ -318,7 +318,7 @@ typedef struct Font { int glyphCount; // Number of glyph characters int glyphPadding; // Padding around the glyph characters Texture2D texture; // Texture atlas containing the glyphs - rlRectangle *recs; // Rectangles in texture for the glyphs + Rectangle *recs; // Rectangles in texture for the glyphs GlyphInfo *glyphs; // Glyphs info data } Font; @@ -966,7 +966,7 @@ extern "C" { // Prevents name mangling of functions // Window-related functions RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context -RLAPI void rlCloseWindow(void); // Close window and unload OpenGL context +RLAPI void CloseWindow(void); // Close window and unload OpenGL context RLAPI bool WindowShouldClose(void); // Check if application should close (KEY_ESCAPE pressed or windows close icon clicked) RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen @@ -1015,7 +1015,7 @@ RLAPI void EnableEventWaiting(void); // Enable wait RLAPI void DisableEventWaiting(void); // Disable waiting for events on EndDrawing(), automatic events polling // Cursor-related functions -RLAPI void rlShowCursor(void); // Shows cursor +RLAPI void ShowCursor(void); // Shows cursor RLAPI void HideCursor(void); // Hides cursor RLAPI bool IsCursorHidden(void); // Check if cursor is not visible RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) @@ -1238,9 +1238,9 @@ RLAPI void UpdateCameraPro(Camera *camera, Vector3 movement, Vector3 rotation, f // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -RLAPI void SetShapesTexture(Texture2D texture, rlRectangle source); // Set texture and rectangle to be used on shapes drawing +RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Set texture and rectangle to be used on shapes drawing RLAPI Texture2D GetShapesTexture(void); // Get texture that is used for shapes drawing -RLAPI rlRectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing +RLAPI Rectangle GetShapesTextureRectangle(void); // Get texture source rectangle that is used for shapes drawing // Basic shapes drawing functions RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel using geometry [Can be slow, use with care] @@ -1263,16 +1263,16 @@ RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, float RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); // Draw ring outline RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) -RLAPI void DrawRectangleRec(rlRectangle rec, Color color); // Draw a color-filled rectangle -RLAPI void DrawRectanglePro(rlRectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters +RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom); // Draw a vertical-gradient-filled rectangle RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right); // Draw a horizontal-gradient-filled rectangle -RLAPI void DrawRectangleGradientEx(rlRectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors +RLAPI void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); // Draw a gradient-filled rectangle with custom vertex colors RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline -RLAPI void DrawRectangleLinesEx(rlRectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters -RLAPI void DrawRectangleRounded(rlRectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges -RLAPI void DrawRectangleRoundedLines(rlRectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges -RLAPI void DrawRectangleRoundedLinesEx(rlRectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline +RLAPI void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); // Draw rectangle outline with extended parameters +RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle lines with rounded edges +RLAPI void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color); // Draw rectangle with rounded edges outline RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) RLAPI void DrawTriangleFan(const Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) @@ -1301,17 +1301,17 @@ RLAPI Vector2 GetSplinePointBezierQuad(Vector2 p1, Vector2 c2, Vector2 p3, float RLAPI Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t); // Get (evaluate) spline point: Cubic Bezier // Basic shapes collision detection functions -RLAPI bool CheckCollisionRecs(rlRectangle rec1, rlRectangle rec2); // Check collision between two rectangles +RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles -RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, rlRectangle rec); // Check collision between circle and rectangle +RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); // Check if circle collides with a line created betweeen two points [p1] and [p2] -RLAPI bool CheckCollisionPointRec(Vector2 point, rlRectangle rec); // Check if point is inside rectangle +RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle RLAPI bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] RLAPI bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount); // Check if point is within a polygon described by array of vertices RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference -RLAPI rlRectangle GetCollisionRec(rlRectangle rec1, rlRectangle rec2); // Get collision rectangle for two rectangles collision +RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision //------------------------------------------------------------------------------------ // Texture Loading and Drawing Functions (Module: textures) @@ -1319,7 +1319,7 @@ RLAPI rlRectangle GetCollisionRec(rlRectangle rec1, rlRectangle rec2); // Image loading functions // NOTE: These functions do not require GPU access -RLAPI Image rlLoadImage(const char *fileName); // Load image from file into CPU memory (RAM) +RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) RLAPI Image LoadImageAnimFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int *frames); // Load image sequence from memory buffer @@ -1345,13 +1345,13 @@ RLAPI Image GenImageText(int width, int height, const char *text); // Image manipulation functions RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) -RLAPI Image ImageFromImage(Image image, rlRectangle rec); // Create an image from another image piece +RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece RLAPI Image ImageFromChannel(Image image, int selectedChannel); // Create an image from a selected channel of another image (GRAYSCALE) RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) -RLAPI void ImageCrop(Image *image, rlRectangle crop); // Crop an image to a defined rectangle +RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image @@ -1378,7 +1378,7 @@ RLAPI Color *LoadImageColors(Image image); RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount); // Load colors palette from image as a Color array (RGBA - 32bit) RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() -RLAPI rlRectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle +RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle RLAPI Color GetImageColor(Image image, int x, int y); // Get image pixel color at (x, y) position // Image drawing functions @@ -1395,14 +1395,14 @@ RLAPI void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color); // Draw circle outline within an image (Vector version) RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) -RLAPI void ImageDrawRectangleRec(Image *dst, rlRectangle rec, Color color); // Draw rectangle within an image -RLAPI void ImageDrawRectangleLines(Image *dst, rlRectangle rec, int thick, Color color); // Draw rectangle lines within an image +RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image RLAPI void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image RLAPI void ImageDrawTriangleFan(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle fan defined by points within an image (first vertex is the center) RLAPI void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color color); // Draw a triangle strip defined by points within an image -RLAPI void ImageDraw(Image *dst, Image src, rlRectangle srcRec, rlRectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) +RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) @@ -1417,7 +1417,7 @@ RLAPI void UnloadTexture(Texture2D texture); RLAPI bool IsRenderTextureValid(RenderTexture2D target); // Check if a render texture is valid (loaded in GPU) RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data -RLAPI void UpdateTextureRec(Texture2D texture, rlRectangle rec, const void *pixels); // Update GPU texture rectangle with new data +RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data // Texture configuration functions RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture @@ -1428,9 +1428,9 @@ RLAPI void SetTextureWrap(Texture2D texture, int wrap); RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -RLAPI void DrawTextureRec(Texture2D texture, rlRectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -RLAPI void DrawTexturePro(Texture2D texture, rlRectangle source, rlRectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters -RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, rlRectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely +RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely // Color/pixel related functions RLAPI bool ColorIsEqual(Color col1, Color col2); // Check if two colors are equal @@ -1463,15 +1463,15 @@ RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' RLAPI bool IsFontValid(Font font); // Check if a font is valid (font data loaded, WARNING: GPU texture not checked) RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *codepoints, int codepointCount, int type); // Load font data for further use -RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, rlRectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info +RLAPI Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFontData(GlyphInfo *glyphs, int glyphCount); // Unload font chars info data (RAM) RLAPI void UnloadFont(Font font); // Unload font from GPU memory (VRAM) RLAPI bool ExportFontAsCode(Font font, const char *fileName); // Export font as code file, returns true on success // Text drawing functions RLAPI void DrawFPS(int posX, int posY); // Draw current FPS -RLAPI void rlDrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -RLAPI void rlDrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters +RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) +RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters RLAPI void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); // Draw text using Font and pro parameters (rotation) RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) RLAPI void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint); // Draw multiple character (codepoint) @@ -1482,7 +1482,7 @@ RLAPI int MeasureText(const char *text, int fontSize); RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font RLAPI int GetGlyphIndex(Font font, int codepoint); // Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found RLAPI GlyphInfo GetGlyphInfo(Font font, int codepoint); // Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found -RLAPI rlRectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found +RLAPI Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found // Text codepoints management functions (unicode characters) RLAPI char *LoadUTF8(const int *codepoints, int length); // Load UTF-8 text encoded from codepoints array @@ -1564,8 +1564,8 @@ RLAPI void DrawModelPoints(Model model, Vector3 position, float scale, Color tin RLAPI void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, rlRectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source -RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, rlRectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source +RLAPI void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); // Draw a billboard texture defined by source and rotation // Mesh management functions RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids diff --git a/src/raylib/rcore.c b/src/raylib/rcore.c index 6f95f1c..9734972 100644 --- a/src/raylib/rcore.c +++ b/src/raylib/rcore.c @@ -664,16 +664,16 @@ void InitWindow(int width, int height, const char *title) #if defined(SUPPORT_MODULE_RSHAPES) // Set font white rectangle for shapes drawing, so shapes and text can be batched together // WARNING: rshapes module is required, if not available, default internal white rectangle is used - rlRectangle rec = GetFontDefault().recs[95]; + Rectangle rec = GetFontDefault().recs[95]; if (CORE.Window.flags & FLAG_MSAA_4X_HINT) { // NOTE: We try to maxime rec padding to avoid pixel bleeding on MSAA filtering - SetShapesTexture(GetFontDefault().texture, (rlRectangle){ rec.x + 2, rec.y + 2, 1, 1 }); + SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 2, rec.y + 2, 1, 1 }); } else { // NOTE: We set up a 1px padding on char rectangle to avoid pixel bleeding - SetShapesTexture(GetFontDefault().texture, (rlRectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); + SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 }); } #endif #endif @@ -682,7 +682,7 @@ void InitWindow(int width, int height, const char *title) // Set default texture and rectangle to be used for shapes drawing // NOTE: rlgl default texture is a 1x1 pixel UNCOMPRESSED_R8G8B8A8 Texture2D texture = { rlGetTextureIdDefault(), 1, 1, 1, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 }; - SetShapesTexture(texture, (rlRectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); // WARNING: Module required: rshapes + SetShapesTexture(texture, (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }); // WARNING: Module required: rshapes #endif #endif @@ -696,7 +696,7 @@ void InitWindow(int width, int height, const char *title) } // Close window and unload OpenGL context -void rlCloseWindow(void) +void CloseWindow(void) { #if defined(SUPPORT_GIF_RECORDING) if (gifRecording) @@ -898,7 +898,7 @@ void EndDrawing(void) if ((int)(GetTime()/0.5)%2 == 1) { DrawCircle(30, CORE.Window.screen.height - 20, 10, MAROON); // WARNING: Module required: rshapes - rlDrawText("GIF RECORDING", 50, CORE.Window.screen.height - 25, 10, RED); // WARNING: Module required: rtext + DrawText("GIF RECORDING", 50, CORE.Window.screen.height - 25, 10, RED); // WARNING: Module required: rtext } #endif diff --git a/src/raylib/rmodels.c b/src/raylib/rmodels.c index a1ebe0d..ed15d96 100644 --- a/src/raylib/rmodels.c +++ b/src/raylib/rmodels.c @@ -3816,13 +3816,13 @@ void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, floa // Draw a billboard void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint) { - rlRectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; + Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; DrawBillboardRec(camera, texture, source, position, (Vector2) { scale*fabsf((float)source.width/source.height), scale }, tint); } // Draw a billboard (part of a texture defined by a rectangle) -void DrawBillboardRec(Camera camera, Texture2D texture, rlRectangle source, Vector3 position, Vector2 size, Color tint) +void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint) { // NOTE: Billboard locked on axis-Y Vector3 up = { 0.0f, 1.0f, 0.0f }; @@ -3831,7 +3831,7 @@ void DrawBillboardRec(Camera camera, Texture2D texture, rlRectangle source, Vect } // Draw a billboard with additional parameters -void DrawBillboardPro(Camera camera, Texture2D texture, rlRectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) +void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) { // Compute the up vector and the right vector Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); @@ -5149,7 +5149,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat } else // Check if image is provided as image path { - image = rlLoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri)); + image = LoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri)); } } else if (cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer diff --git a/src/raylib/rshapes.c b/src/raylib/rshapes.c index b8caddd..ece5513 100644 --- a/src/raylib/rshapes.c +++ b/src/raylib/rshapes.c @@ -80,7 +80,7 @@ // Global Variables Definition //---------------------------------------------------------------------------------- static Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used on shapes drawing (white pixel loaded by rlgl) -static rlRectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing +static Rectangle texShapesRec = { 0.0f, 0.0f, 1.0f, 1.0f }; // Texture source rectangle used on shapes drawing //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -94,7 +94,7 @@ static float EaseCubicInOut(float t, float b, float c, float d); // Cubic eas // Set texture and rectangle to be used on shapes drawing // NOTE: It can be useful when using basic shapes and one single font, // defining a font char white rectangle would allow drawing everything in a single draw call -void SetShapesTexture(Texture2D texture, rlRectangle source) +void SetShapesTexture(Texture2D texture, Rectangle source) { // Reset texture to default pixel if required // WARNING: Shapes texture should be probably better validated, @@ -102,7 +102,7 @@ void SetShapesTexture(Texture2D texture, rlRectangle source) if ((texture.id == 0) || (source.width == 0) || (source.height == 0)) { texShapes = (Texture2D){ 1, 1, 1, 1, 7 }; - texShapesRec = (rlRectangle){ 0.0f, 0.0f, 1.0f, 1.0f }; + texShapesRec = (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f }; } else { @@ -118,7 +118,7 @@ Texture2D GetShapesTexture(void) } // Get texture source rectangle that is used for shapes drawing -rlRectangle GetShapesTextureRectangle(void) +Rectangle GetShapesTextureRectangle(void) { return texShapesRec; } @@ -134,7 +134,7 @@ void DrawPixelV(Vector2 position, Color color) { #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); @@ -312,7 +312,7 @@ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endA #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); @@ -540,7 +540,7 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startA #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); for (int i = 0; i < segments; i++) @@ -669,17 +669,17 @@ void DrawRectangle(int posX, int posY, int width, int height, Color color) // NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues void DrawRectangleV(Vector2 position, Vector2 size, Color color) { - DrawRectanglePro((rlRectangle){ position.x, position.y, size.x, size.y }, (Vector2){ 0.0f, 0.0f }, 0.0f, color); + DrawRectanglePro((Rectangle){ position.x, position.y, size.x, size.y }, (Vector2){ 0.0f, 0.0f }, 0.0f, color); } // Draw a color-filled rectangle -void DrawRectangleRec(rlRectangle rec, Color color) +void DrawRectangleRec(Rectangle rec, Color color) { DrawRectanglePro(rec, (Vector2){ 0.0f, 0.0f }, 0.0f, color); } // Draw a color-filled rectangle with pro parameters -void DrawRectanglePro(rlRectangle rec, Vector2 origin, float rotation, Color color) +void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color) { Vector2 topLeft = { 0 }; Vector2 topRight = { 0 }; @@ -720,7 +720,7 @@ void DrawRectanglePro(rlRectangle rec, Vector2 origin, float rotation, Color col #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); @@ -762,20 +762,20 @@ void DrawRectanglePro(rlRectangle rec, Vector2 origin, float rotation, Color col // Draw a vertical-gradient-filled rectangle void DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom) { - DrawRectangleGradientEx((rlRectangle){ (float)posX, (float)posY, (float)width, (float)height }, top, bottom, bottom, top); + DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, top, bottom, bottom, top); } // Draw a horizontal-gradient-filled rectangle void DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right) { - DrawRectangleGradientEx((rlRectangle){ (float)posX, (float)posY, (float)width, (float)height }, left, left, right, right); + DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, left, left, right, right); } // Draw a gradient-filled rectangle -void DrawRectangleGradientEx(rlRectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight) +void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight) { rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); rlNormal3f(0.0f, 0.0f, 1.0f); @@ -850,7 +850,7 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) } // Draw rectangle outline with extended parameters -void DrawRectangleLinesEx(rlRectangle rec, float lineThick, Color color) +void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color) { if ((lineThick > rec.width) || (lineThick > rec.height)) { @@ -869,10 +869,10 @@ void DrawRectangleLinesEx(rlRectangle rec, float lineThick, Color color) // BBBBBBBB // - rlRectangle top = { rec.x, rec.y, rec.width, lineThick }; - rlRectangle bottom = { rec.x, rec.y - lineThick + rec.height, rec.width, lineThick }; - rlRectangle left = { rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; - rlRectangle right = { rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; + Rectangle top = { rec.x, rec.y, rec.width, lineThick }; + Rectangle bottom = { rec.x, rec.y - lineThick + rec.height, rec.width, lineThick }; + Rectangle left = { rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; + Rectangle right = { rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f }; DrawRectangleRec(top, color); DrawRectangleRec(bottom, color); @@ -881,7 +881,7 @@ void DrawRectangleLinesEx(rlRectangle rec, float lineThick, Color color) } // Draw rectangle with rounded edges -void DrawRectangleRounded(rlRectangle rec, float roundness, int segments, Color color) +void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color) { // Not a rounded rectangle if ((roundness <= 0.0f) || (rec.width < 1) || (rec.height < 1 )) @@ -937,7 +937,7 @@ void DrawRectangleRounded(rlRectangle rec, float roundness, int segments, Color #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); // Draw all the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner @@ -1108,20 +1108,20 @@ void DrawRectangleRounded(rlRectangle rec, float roundness, int segments, Color // Draw rectangle with rounded edges // TODO: This function should be refactored to use RL_LINES, for consistency with other Draw*Lines() -void DrawRectangleRoundedLines(rlRectangle rec, float roundness, int segments, Color color) +void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color) { DrawRectangleRoundedLinesEx(rec, roundness, segments, 1.0f, color); } // Draw rectangle with rounded edges outline -void DrawRectangleRoundedLinesEx(rlRectangle rec, float roundness, int segments, float lineThick, Color color) +void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float lineThick, Color color) { if (lineThick < 0) lineThick = 0; // Not a rounded rectangle if (roundness <= 0.0f) { - DrawRectangleLinesEx((rlRectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color); + DrawRectangleLinesEx((Rectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color); return; } @@ -1180,7 +1180,7 @@ void DrawRectangleRoundedLinesEx(rlRectangle rec, float roundness, int segments, { #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); @@ -1356,7 +1356,7 @@ void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) { #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); rlColor4ub(color.r, color.g, color.b, color.a); @@ -1410,7 +1410,7 @@ void DrawTriangleFan(const Vector2 *points, int pointCount, Color color) if (pointCount >= 3) { rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); rlColor4ub(color.r, color.g, color.b, color.a); @@ -1471,7 +1471,7 @@ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color col #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); for (int i = 0; i < sides; i++) @@ -1540,7 +1540,7 @@ void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, fl #if defined(SUPPORT_QUADS_DRAW_MODE) rlSetTexture(GetShapesTexture().id); - rlRectangle shapeRect = GetShapesTextureRectangle(); + Rectangle shapeRect = GetShapesTextureRectangle(); rlBegin(RL_QUADS); for (int i = 0; i < sides; i++) @@ -2180,7 +2180,7 @@ Vector2 GetSplinePointBezierCubic(Vector2 startPos, Vector2 startControlPos, Vec //---------------------------------------------------------------------------------- // Check if point is inside rectangle -bool CheckCollisionPointRec(Vector2 point, rlRectangle rec) +bool CheckCollisionPointRec(Vector2 point, Rectangle rec) { bool collision = false; @@ -2241,7 +2241,7 @@ bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCoun } // Check collision between two rectangles -bool CheckCollisionRecs(rlRectangle rec1, rlRectangle rec2) +bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2) { bool collision = false; @@ -2269,7 +2269,7 @@ bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, floa // Check collision between circle and rectangle // NOTE: Reviewed version to take into account corner limit case -bool CheckCollisionCircleRec(Vector2 center, float radius, rlRectangle rec) +bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec) { bool collision = false; @@ -2367,9 +2367,9 @@ RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Ve } // Get collision rectangle for two rectangles collision -rlRectangle GetCollisionRec(rlRectangle rec1, rlRectangle rec2) +Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) { - rlRectangle overlap = { 0 }; + Rectangle overlap = { 0 }; float left = (rec1.x > rec2.x)? rec1.x : rec2.x; float right1 = rec1.x + rec1.width; diff --git a/src/raylib/rtext.c b/src/raylib/rtext.c index 415aae4..3510671 100644 --- a/src/raylib/rtext.c +++ b/src/raylib/rtext.c @@ -7,8 +7,8 @@ * rtext module is included in the build * * #define SUPPORT_DEFAULT_FONT -* Load default raylib font on initialization to be used by rlDrawText() and MeasureText(). -* If no default font loaded, rlDrawTextEx() and MeasureTextEx() are required. +* Load default raylib font on initialization to be used by DrawText() and MeasureText(). +* If no default font loaded, DrawTextEx() and MeasureTextEx() are required. * * #define SUPPORT_FILEFORMAT_FNT * #define SUPPORT_FILEFORMAT_TTF @@ -261,7 +261,7 @@ extern void LoadFontDefault(void) // Allocate space for our characters info data // NOTE: This memory must be freed at end! --> Done by CloseWindow() defaultFont.glyphs = (GlyphInfo *)RL_CALLOC(defaultFont.glyphCount, sizeof(GlyphInfo)); - defaultFont.recs = (rlRectangle *)RL_CALLOC(defaultFont.glyphCount, sizeof(rlRectangle)); + defaultFont.recs = (Rectangle *)RL_CALLOC(defaultFont.glyphCount, sizeof(Rectangle)); int currentLine = 0; int currentPosX = charsDivisor; @@ -358,7 +358,7 @@ Font LoadFont(const char *fileName) else #endif { - Image image = rlLoadImage(fileName); + Image image = LoadImage(fileName); if (image.data != NULL) font = LoadFontFromImage(image, MAGENTA, FONT_TTF_DEFAULT_FIRST_CHAR); UnloadImage(image); } @@ -418,7 +418,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) // We allocate a temporal arrays for chars data measures, // once we get the actual number of chars, we copy data to a sized arrays int tempCharValues[MAX_GLYPHS_FROM_IMAGE] = { 0 }; - rlRectangle tempCharRecs[MAX_GLYPHS_FROM_IMAGE] = { 0 }; + Rectangle tempCharRecs[MAX_GLYPHS_FROM_IMAGE] = { 0 }; Color *pixels = LoadImageColors(image); @@ -498,7 +498,7 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) // We got tempCharValues and tempCharsRecs populated with chars data // Now we move temp data to sized charValues and charRecs arrays font.glyphs = (GlyphInfo *)RL_MALLOC(font.glyphCount*sizeof(GlyphInfo)); - font.recs = (rlRectangle *)RL_MALLOC(font.glyphCount*sizeof(rlRectangle)); + font.recs = (Rectangle *)RL_MALLOC(font.glyphCount*sizeof(Rectangle)); for (int i = 0; i < font.glyphCount; i++) { @@ -735,7 +735,7 @@ GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSiz // Generate image font atlas using chars info // NOTE: Packing method: 0-Default, 1-Skyline #if defined(SUPPORT_FILEFORMAT_TTF) || defined(SUPPORT_FILEFORMAT_BDF) -Image GenImageFontAtlas(const GlyphInfo *glyphs, rlRectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod) +Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyphCount, int fontSize, int padding, int packMethod) { Image atlas = { 0 }; @@ -751,7 +751,7 @@ Image GenImageFontAtlas(const GlyphInfo *glyphs, rlRectangle **glyphRecs, int gl glyphCount = (glyphCount > 0)? glyphCount : 95; // NOTE: Rectangles memory is loaded here! - rlRectangle *recs = (rlRectangle *)RL_MALLOC(glyphCount*sizeof(rlRectangle)); + Rectangle *recs = (Rectangle *)RL_MALLOC(glyphCount*sizeof(Rectangle)); // Calculate image size based on total glyph width and glyph row count int totalWidth = 0; @@ -1035,7 +1035,7 @@ bool ExportFontAsCode(Font font, const char *fileName) // Save font recs data byteCount += sprintf(txtData + byteCount, "// Font characters rectangles data\n"); - byteCount += sprintf(txtData + byteCount, "static rlRectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); + byteCount += sprintf(txtData + byteCount, "static Rectangle fontRecs_%s[%i] = {\n", fileNamePascal, font.glyphCount); for (int i = 0; i < font.glyphCount; i++) { byteCount += sprintf(txtData + byteCount, " { %1.0f, %1.0f, %1.0f , %1.0f },\n", font.recs[i].x, font.recs[i].y, font.recs[i].width, font.recs[i].height); @@ -1083,8 +1083,8 @@ bool ExportFontAsCode(Font font, const char *fileName) #if defined(SUPPORT_FONT_DATA_COPY) byteCount += sprintf(txtData + byteCount, " // Copy glyph recs data from global fontRecs\n"); byteCount += sprintf(txtData + byteCount, " // NOTE: Required to avoid issues if trying to free font\n"); - byteCount += sprintf(txtData + byteCount, " font.recs = (rlRectangle *)malloc(font.glyphCount*sizeof(rlRectangle));\n"); - byteCount += sprintf(txtData + byteCount, " memcpy(font.recs, fontRecs_%s, font.glyphCount*sizeof(rlRectangle));\n\n", fileNamePascal); + byteCount += sprintf(txtData + byteCount, " font.recs = (Rectangle *)malloc(font.glyphCount*sizeof(Rectangle));\n"); + byteCount += sprintf(txtData + byteCount, " memcpy(font.recs, fontRecs_%s, font.glyphCount*sizeof(Rectangle));\n\n", fileNamePascal); byteCount += sprintf(txtData + byteCount, " // Copy font glyph info data from global fontChars\n"); byteCount += sprintf(txtData + byteCount, " // NOTE: Required to avoid issues if trying to free font\n"); @@ -1122,13 +1122,13 @@ void DrawFPS(int posX, int posY) if ((fps < 30) && (fps >= 15)) color = ORANGE; // Warning FPS else if (fps < 15) color = RED; // Low FPS - rlDrawText(TextFormat("%2i FPS", fps), posX, posY, 20, color); + DrawText(TextFormat("%2i FPS", fps), posX, posY, 20, color); } // Draw text (using default font) // NOTE: fontSize work like in any drawing program but if fontSize is lower than font-base-size, then font-base-size is used // NOTE: chars spacing is proportional to fontSize -void rlDrawText(const char *text, int posX, int posY, int fontSize, Color color) +void DrawText(const char *text, int posX, int posY, int fontSize, Color color) { // Check if default font has been loaded if (GetFontDefault().texture.id != 0) @@ -1139,13 +1139,13 @@ void rlDrawText(const char *text, int posX, int posY, int fontSize, Color color) if (fontSize < defaultFontSize) fontSize = defaultFontSize; int spacing = fontSize/defaultFontSize; - rlDrawTextEx(GetFontDefault(), text, position, (float)fontSize, (float)spacing, color); + DrawTextEx(GetFontDefault(), text, position, (float)fontSize, (float)spacing, color); } } // Draw text using Font // NOTE: chars spacing is NOT proportional to fontSize -void rlDrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) +void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) { if (font.texture.id == 0) font = GetFontDefault(); // Security check in case of not valid font @@ -1193,7 +1193,7 @@ void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, rlRotatef(rotation, 0.0f, 0.0f, 1.0f); rlTranslatef(-origin.x, -origin.y, 0.0f); - rlDrawTextEx(font, text, (Vector2){ 0.0f, 0.0f }, fontSize, spacing, tint); + DrawTextEx(font, text, (Vector2){ 0.0f, 0.0f }, fontSize, spacing, tint); rlPopMatrix(); } @@ -1208,14 +1208,14 @@ void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSiz // Character destination rectangle on screen // NOTE: We consider glyphPadding on drawing - rlRectangle dstRec = { position.x + font.glyphs[index].offsetX*scaleFactor - (float)font.glyphPadding*scaleFactor, + Rectangle dstRec = { position.x + font.glyphs[index].offsetX*scaleFactor - (float)font.glyphPadding*scaleFactor, position.y + font.glyphs[index].offsetY*scaleFactor - (float)font.glyphPadding*scaleFactor, (font.recs[index].width + 2.0f*font.glyphPadding)*scaleFactor, (font.recs[index].height + 2.0f*font.glyphPadding)*scaleFactor }; // Character source rectangle from font texture atlas // NOTE: We consider chars padding when drawing, it could be required for outline/glow shader effects - rlRectangle srcRec = { font.recs[index].x - (float)font.glyphPadding, font.recs[index].y - (float)font.glyphPadding, + Rectangle srcRec = { font.recs[index].x - (float)font.glyphPadding, font.recs[index].y - (float)font.glyphPadding, font.recs[index].width + 2.0f*font.glyphPadding, font.recs[index].height + 2.0f*font.glyphPadding }; // Draw the character texture on the screen @@ -1376,9 +1376,9 @@ GlyphInfo GetGlyphInfo(Font font, int codepoint) // Get glyph rectangle in font atlas for a codepoint (unicode character) // NOTE: If codepoint is not found in the font it fallbacks to '?' -rlRectangle GetGlyphAtlasRec(Font font, int codepoint) +Rectangle GetGlyphAtlasRec(Font font, int codepoint) { - rlRectangle rec = { 0 }; + Rectangle rec = { 0 }; rec = font.recs[GetGlyphIndex(font, codepoint)]; @@ -2219,7 +2219,7 @@ static Font LoadBMFont(const char *fileName) for (int i = 0; i < pageCount; i++) { - imFonts[i] = rlLoadImage(TextFormat("%s/%s", GetDirectoryPath(fileName), imFileName[i])); + imFonts[i] = LoadImage(TextFormat("%s/%s", GetDirectoryPath(fileName), imFileName[i])); if (imFonts[i].format == PIXELFORMAT_UNCOMPRESSED_GRAYSCALE) { @@ -2255,8 +2255,8 @@ static Font LoadBMFont(const char *fileName) for (int i = 1; i < pageCount; i++) { - rlRectangle srcRec = { 0.0f, 0.0f, (float)imWidth, (float)imHeight }; - rlRectangle destRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; + Rectangle srcRec = { 0.0f, 0.0f, (float)imWidth, (float)imHeight }; + Rectangle destRec = { 0.0f, (float)imHeight*(float)i, (float)imWidth, (float)imHeight }; ImageDraw(&fullFont, imFonts[i], srcRec, destRec, WHITE); } } @@ -2270,7 +2270,7 @@ static Font LoadBMFont(const char *fileName) font.glyphCount = glyphCount; font.glyphPadding = 0; font.glyphs = (GlyphInfo *)RL_MALLOC(glyphCount*sizeof(GlyphInfo)); - font.recs = (rlRectangle *)RL_MALLOC(glyphCount*sizeof(rlRectangle)); + font.recs = (Rectangle *)RL_MALLOC(glyphCount*sizeof(Rectangle)); int charId, charX, charY, charWidth, charHeight, charOffsetX, charOffsetY, charAdvanceX, pageID; @@ -2284,7 +2284,7 @@ static Font LoadBMFont(const char *fileName) if (readVars == 9) // Make sure all char data has been properly read { // Get character rectangle in the font atlas texture - font.recs[i] = (rlRectangle){ (float)charX, (float)charY + (float)imHeight*pageID, (float)charWidth, (float)charHeight }; + font.recs[i] = (Rectangle){ (float)charX, (float)charY + (float)imHeight*pageID, (float)charWidth, (float)charHeight }; // Save data properly in sprite font font.glyphs[i].value = charId; diff --git a/src/raylib/rtextures.c b/src/raylib/rtextures.c index 179009b..ca3ad09 100644 --- a/src/raylib/rtextures.c +++ b/src/raylib/rtextures.c @@ -263,7 +263,7 @@ static Vector4 *LoadImageDataNormalized(Image image); // Load pixel data f //---------------------------------------------------------------------------------- // Load image from file into CPU memory (RAM) -Image rlLoadImage(const char *fileName) +Image LoadImage(const char *fileName) { Image image = { 0 }; @@ -361,7 +361,7 @@ Image LoadImageAnim(const char *fileName, int *frames) #endif else { - image = rlLoadImage(fileName); + image = LoadImage(fileName); frameCount = 1; } @@ -1167,7 +1167,7 @@ Image ImageCopy(Image image) } // Create an image from another image piece -Image ImageFromImage(Image image, rlRectangle rec) +Image ImageFromImage(Image image, Rectangle rec) { Image result = { 0 }; @@ -1189,7 +1189,7 @@ Image ImageFromImage(Image image, rlRectangle rec) // Crop an image to area defined by a rectangle // NOTE: Security checks are performed in case rectangle goes out of bounds -void ImageCrop(Image *image, rlRectangle crop) +void ImageCrop(Image *image, Rectangle crop) { // Security check to avoid program crash if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; @@ -1499,8 +1499,8 @@ Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Co { if ((codepoint != ' ') && (codepoint != '\t')) { - rlRectangle rec = { (float)(textOffsetX + font.glyphs[index].offsetX), (float)(textOffsetY + font.glyphs[index].offsetY), (float)font.recs[index].width, (float)font.recs[index].height }; - ImageDraw(&imText, font.glyphs[index].image, (rlRectangle){ 0, 0, (float)font.glyphs[index].image.width, (float)font.glyphs[index].image.height }, rec, tint); + Rectangle rec = { (float)(textOffsetX + font.glyphs[index].offsetX), (float)(textOffsetY + font.glyphs[index].offsetY), (float)font.recs[index].width, (float)font.recs[index].height }; + ImageDraw(&imText, font.glyphs[index].image, (Rectangle){ 0, 0, (float)font.glyphs[index].image.width, (float)font.glyphs[index].image.height }, rec, tint); } if (font.glyphs[index].advanceX == 0) textOffsetX += (int)(font.recs[index].width + spacing); @@ -1802,7 +1802,7 @@ void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, i if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else if ((newWidth != image->width) || (newHeight != image->height)) { - rlRectangle srcRec = { 0, 0, (float)image->width, (float)image->height }; + Rectangle srcRec = { 0, 0, (float)image->width, (float)image->height }; Vector2 dstPos = { (float)offsetX, (float)offsetY }; if (offsetX < 0) @@ -1882,7 +1882,7 @@ void ImageAlphaCrop(Image *image, float threshold) // Security check to avoid program crash if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; - rlRectangle crop = GetImageAlphaBorder(*image, threshold); + Rectangle crop = GetImageAlphaBorder(*image, threshold); // Crop if rectangle is valid if (((int)crop.width != 0) && ((int)crop.height != 0)) ImageCrop(image, crop); @@ -3134,9 +3134,9 @@ void UnloadImagePalette(Color *colors) // Get image alpha border rectangle // NOTE: Threshold is defined as a percentage: 0.0f -> 1.0f -rlRectangle GetImageAlphaBorder(Image image, float threshold) +Rectangle GetImageAlphaBorder(Image image, float threshold) { - rlRectangle crop = { 0 }; + Rectangle crop = { 0 }; Color *pixels = LoadImageColors(image); @@ -3164,7 +3164,7 @@ rlRectangle GetImageAlphaBorder(Image image, float threshold) // Check for empty blank image if ((xMin != 65536) && (xMax != 65536)) { - crop = (rlRectangle){ (float)xMin, (float)yMin, (float)((xMax + 1) - xMin), (float)((yMax + 1) - yMin) }; + crop = (Rectangle){ (float)xMin, (float)yMin, (float)((xMax + 1) - xMin), (float)((yMax + 1) - yMin) }; } UnloadImageColors(pixels); @@ -3647,7 +3647,7 @@ void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) // Draw rectangle within an image void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color) { - ImageDrawRectangleRec(dst, (rlRectangle){ (float)posX, (float)posY, (float)width, (float)height }, color); + ImageDrawRectangleRec(dst, (Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color); } // Draw rectangle within an image (Vector version) @@ -3657,7 +3657,7 @@ void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color } // Draw rectangle within an image -void ImageDrawRectangleRec(Image *dst, rlRectangle rec, Color color) +void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) { // Security check to avoid program crash if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0)) return; @@ -3702,7 +3702,7 @@ void ImageDrawRectangleRec(Image *dst, rlRectangle rec, Color color) } // Draw rectangle lines within an image -void ImageDrawRectangleLines(Image *dst, rlRectangle rec, int thick, Color color) +void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color) { ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color); ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + thick), thick, (int)(rec.height - thick*2), color); @@ -3900,7 +3900,7 @@ void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int pointCount, Color c // Draw an image (source) within an image (destination) // NOTE: Color tint is applied to source image -void ImageDraw(Image *dst, Image src, rlRectangle srcRec, rlRectangle dstRec, Color tint) +void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint) { // Security check to avoid program crash if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0) || @@ -3926,7 +3926,7 @@ void ImageDraw(Image *dst, Image src, rlRectangle srcRec, rlRectangle dstRec, Co { srcMod = ImageFromImage(src, srcRec); // Create image from another image ImageResize(&srcMod, (int)dstRec.width, (int)dstRec.height); // Resize to destination rectangle - srcRec = (rlRectangle){ 0, 0, (float)srcMod.width, (float)srcMod.height }; + srcRec = (Rectangle){ 0, 0, (float)srcMod.width, (float)srcMod.height }; srcPtr = &srcMod; useSrcMod = true; @@ -4041,8 +4041,8 @@ void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, { Image imText = ImageTextEx(font, text, fontSize, spacing, tint); - rlRectangle srcRec = { 0.0f, 0.0f, (float)imText.width, (float)imText.height }; - rlRectangle dstRec = { position.x, position.y, (float)imText.width, (float)imText.height }; + Rectangle srcRec = { 0.0f, 0.0f, (float)imText.width, (float)imText.height }; + Rectangle dstRec = { position.x, position.y, (float)imText.width, (float)imText.height }; ImageDraw(dst, imText, srcRec, dstRec, WHITE); @@ -4057,7 +4057,7 @@ Texture2D LoadTexture(const char *fileName) { Texture2D texture = { 0 }; - Image image = rlLoadImage(fileName); + Image image = LoadImage(fileName); if (image.data != NULL) { @@ -4123,9 +4123,9 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) int size = cubemap.width; Image faces = { 0 }; // Vertical column image - rlRectangle faceRecs[6] = { 0 }; // Face source rectangles + Rectangle faceRecs[6] = { 0 }; // Face source rectangles - for (int i = 0; i < 6; i++) faceRecs[i] = (rlRectangle){ 0, 0, (float)size, (float)size }; + for (int i = 0; i < 6; i++) faceRecs[i] = (Rectangle){ 0, 0, (float)size, (float)size }; if (layout == CUBEMAP_LAYOUT_LINE_VERTICAL) { @@ -4164,7 +4164,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) // NOTE: Image formatting does not work with compressed textures - for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (rlRectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE); + for (int i = 0; i < 6; i++) ImageDraw(&faces, image, faceRecs[i], (Rectangle){ 0, (float)size*i, (float)size, (float)size }, WHITE); } // NOTE: Cubemap data is expected to be provided as 6 images in a single data array, @@ -4290,7 +4290,7 @@ void UpdateTexture(Texture2D texture, const void *pixels) // Update GPU texture rectangle with new data // NOTE: pixels data must match texture.format -void UpdateTextureRec(Texture2D texture, rlRectangle rec, const void *pixels) +void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels) { rlUpdateTexture(texture.id, (int)rec.x, (int)rec.y, (int)rec.width, (int)rec.height, texture.format, pixels); } @@ -4420,17 +4420,17 @@ void DrawTextureV(Texture2D texture, Vector2 position, Color tint) // Draw a texture with extended parameters void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) { - rlRectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; - rlRectangle dest = { position.x, position.y, (float)texture.width*scale, (float)texture.height*scale }; + Rectangle source = { 0.0f, 0.0f, (float)texture.width, (float)texture.height }; + Rectangle dest = { position.x, position.y, (float)texture.width*scale, (float)texture.height*scale }; Vector2 origin = { 0.0f, 0.0f }; DrawTexturePro(texture, source, dest, origin, rotation, tint); } // Draw a part of a texture (defined by a rectangle) -void DrawTextureRec(Texture2D texture, rlRectangle source, Vector2 position, Color tint) +void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint) { - rlRectangle dest = { position.x, position.y, fabsf(source.width), fabsf(source.height) }; + Rectangle dest = { position.x, position.y, fabsf(source.width), fabsf(source.height) }; Vector2 origin = { 0.0f, 0.0f }; DrawTexturePro(texture, source, dest, origin, 0.0f, tint); @@ -4438,7 +4438,7 @@ void DrawTextureRec(Texture2D texture, rlRectangle source, Vector2 position, Col // Draw a part of a texture (defined by a rectangle) with 'pro' parameters // NOTE: origin is relative to destination rectangle size -void DrawTexturePro(Texture2D texture, rlRectangle source, rlRectangle dest, Vector2 origin, float rotation, Color tint) +void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint) { // Check if texture is valid if (texture.id > 0) @@ -4563,7 +4563,7 @@ void DrawTexturePro(Texture2D texture, rlRectangle source, rlRectangle dest, Vec } // Draws a texture (or part of it) that stretches or shrinks nicely using n-patch info -void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, rlRectangle dest, Vector2 origin, float rotation, Color tint) +void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint) { if (texture.id > 0) { diff --git a/tests/basic_window.nim b/tests/basic_window.nim index e6c0b0e..becf1db 100644 --- a/tests/basic_window.nim +++ b/tests/basic_window.nim @@ -22,7 +22,7 @@ # # **************************************************************************************** -import raylib, rlgl, raymath, rmem, reasings +import raylib, rlgl, raymath, rmem, reasings, std/[osproc, locks] # ---------------------------------------------------------------------------------------- # Global Variables Definition @@ -37,7 +37,7 @@ const # ---------------------------------------------------------------------------------------- proc testShowCursor() = - showCursor() + raylib.showCursor() proc testDrawRectangle() = let rec = Rectangle(x: 100, y: 100, width: 200, height: 150) @@ -58,6 +58,22 @@ proc testDrawTextWithFont() = let position = Vector2(x: 200, y: 200) drawText(font, "Hello with custom font", position, 24, 2, DarkGray) +# Additional module tests + +proc testOsproc() = + let (output, exitCode) = execCmdEx("echo Hello from subprocess") + echo "Subprocess output: ", output + echo "Exit code: ", exitCode + +proc testLocks() = + var lock: Lock + initLock(lock) + + withLock(lock): + echo "This is executed in a locked state" + + deinitLock(lock) + # ---------------------------------------------------------------------------------------- # Program main entry point # ---------------------------------------------------------------------------------------- @@ -76,6 +92,10 @@ proc main = testDrawText() testDrawTextWithFont() + # Run additional module tests + testOsproc() + testLocks() + # Main game loop while not windowShouldClose(): # Detect window close button or ESC key # Update diff --git a/update_bindings.nims b/update_bindings.nims index e625d7c..1db3ae4 100644 --- a/update_bindings.nims +++ b/update_bindings.nims @@ -5,7 +5,7 @@ const PkgDir = thisDir() RaylibDir = PkgDir / "raylib" RaylibGit = "https://github.com/raysan5/raylib.git" - RayLatestCommit = "110ee74875412beb41ffb53330b47ec9cb052b2d" + RayLatestCommit = "15f6c47f0715afd1fce52d760053026c2b92214c" ApiDir = PkgDir / "wrapper/api" DocsDir = PkgDir / "docs" ParserDir = RaylibDir / "parser" @@ -70,15 +70,11 @@ task genWrappers, "Generate Nim wrappers": # genWrapper("raymath") genWrapper("rlgl") -task patch, "Patch raylib": - withDir(PkgDir / "src/raylib"): - let patchPath = PkgDir / "mangle_names.patch" - exec "git apply --reject " & patchPath.quoteShell - task update, "Update the raylib git directory": fetchLatestRaylib() rmDir(PkgDir / "src/raylib") cpDir(RaylibDir / "src", PkgDir / "src/raylib") + cpFile(PkgDir / "src/naylib.h", PkgDir / "src/raylib/naylib.h") task wrap, "Produce all raylib Nim wrappers": buildToolsTask() diff --git a/wrapper/builder.nim b/wrapper/builder.nim index 559cb10..3b7461f 100644 --- a/wrapper/builder.nim +++ b/wrapper/builder.nim @@ -103,10 +103,7 @@ proc generateObject*(b: var Builder, obj: StructInfo) = if isPrivate notin obj.flags: b.addRaw "*" b.addRaw " {.importc" - if isMangled in obj.flags: - b.addRaw ": " - b.addStrLit "rl" & obj.name - elif obj.importName != "": + if obj.importName != "": b.addRaw ": " b.addStrLit obj.importName b.addRaw ", header: " diff --git a/wrapper/config/raylib.cfg b/wrapper/config/raylib.cfg index afdda13..56824df 100644 --- a/wrapper/config/raylib.cfg +++ b/wrapper/config/raylib.cfg @@ -2,7 +2,7 @@ [ General ] apiDefinition = api/raylib.json -cHeader = raylib.h +cHeader = naylib.h [ Snippets ] @@ -557,15 +557,6 @@ IsMusicValid GetMusicTimeLength IsAudioStreamValid -[ MangledSymbols ] - -ShowCursor -CloseWindow -LoadImage -DrawText -DrawTextEx -Rectangle - [ IncompleteStructs ] rAudioBuffer diff --git a/wrapper/processor.nim b/wrapper/processor.nim index 8df7791..6421919 100644 --- a/wrapper/processor.nim +++ b/wrapper/processor.nim @@ -106,6 +106,8 @@ proc preprocessStructs(ctx: var ApiContext, config: ConfigData) = proc processStructs*(ctx: var ApiContext; config: ConfigData) = preprocessStructs(ctx, config) for obj in mitems(ctx.api.structs): + if isMangled in obj.flags: + obj.importName = "rl" & obj.name if shouldRemoveNamespacePrefix(obj.name, config): obj.importName = obj.name removePrefix(obj.name, config.namespacePrefix)