From 9defc5435dece635fae3fe7fd7556d37a659a3d0 Mon Sep 17 00:00:00 2001 From: PanicTitan <66186142+PanicTitan@users.noreply.github.com> Date: Sun, 23 Aug 2026 17:39:29 -0300 Subject: [PATCH] Using raygui button --- examples/models/models_procedural_decals.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/examples/models/models_procedural_decals.c b/examples/models/models_procedural_decals.c index 692da7bc7..ee636acff 100644 --- a/examples/models/models_procedural_decals.c +++ b/examples/models/models_procedural_decals.c @@ -24,6 +24,8 @@ ********************************************************************************************/ #include "raylib.h" +#define RAYGUI_IMPLEMENTATION +#include "raygui.h" #include "raymath.h" #include // Required for: NULL @@ -55,7 +57,6 @@ static void FreeMeshBuilder(MeshBuilder *mb); static Mesh BuildMesh(MeshBuilder *mb); static Vector3 ClipSegment(Vector3 v0, Vector3 v1, Vector3 p, float s); static Mesh GenMeshDecal(Model model, Matrix projection, float decalSize, float decalOffset); -static bool GuiButton(Rectangle rec, const char *label); //------------------------------------------------------------------------------------ // Program main entry point @@ -501,19 +502,3 @@ static Mesh GenMeshDecal(Model model, Matrix projection, float decalSize, float return decalMesh; } - -// Minimal toggle-style GUI button -static bool GuiButton(Rectangle rec, const char *label) -{ - bool hovered = CheckCollisionPointRec(GetMousePosition(), rec); - bool pressed = hovered && IsMouseButtonPressed(MOUSE_BUTTON_LEFT); - - DrawRectangleRec(rec, hovered ? LIGHTGRAY : GRAY); - DrawRectangleLinesEx(rec, 2.0f, DARKGRAY); - - int fontSize = 10; - int textWidth = MeasureText(label, fontSize); - DrawText(label, (int)(rec.x + rec.width*0.5f - textWidth*0.5f), (int)(rec.y + rec.height*0.5f - fontSize*0.5f), fontSize, DARKGRAY); - - return pressed; -}