EditorSDL

This commit is contained in:
e2hang
2025-12-24 13:15:25 +08:00
parent 4ef0464969
commit fd77d3aca9
303 changed files with 248721 additions and 0 deletions

19
editor/button.cpp~ Normal file
View File

@@ -0,0 +1,19 @@
#include "SDL3/SDL_video.h"
#include <button.h>
Button::Button(int x, int y, int w, int h) {
rect = {x, y, w, h};
hovered = false;
pressed = false;
clicked = false;
}
void Button::updateHover(int mouseX, int mouseY){
hovered = mouseX >= rect.x && mouseX <= rect.x + rect.w && mouseY >= rect.y && mouseY <= rect.y + rect.w;
}