big refactor: i see i need header files

This commit is contained in:
huaqo-games
2025-11-02 11:23:26 +01:00
parent 297a835780
commit c1a2448126
38 changed files with 582 additions and 560 deletions
+23
View File
@@ -0,0 +1,23 @@
#define RAYGUI_IMPLEMENTATION
#include "engine.h"
Button initButton(char *text, Vector2 dimensions, Vector2 position)
{
Button b;
b.rec = (Rectangle){position.x - dimensions.x / 2, position.y - dimensions.y / 2, dimensions.x, dimensions.y};
b.text = text;
return b;
}
int isButtonClicked(Button *b)
{
return (CheckCollisionPointRec(GetMousePosition(), b->rec) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON));
}
void renderButton(Button *b)
{
GuiButton(b->rec, b->text);
}