34 lines
552 B
C
34 lines
552 B
C
#ifndef BUTTON_H_
|
|
#define BUTTON_H_
|
|
|
|
|
|
#include "SDL3/SDL_events.h"
|
|
#include "SDL3/SDL_oldnames.h"
|
|
#include <SDL3/SDL.h>
|
|
#include <SDL3/SDL_main.h>
|
|
//Need To Memorize How To Write Stuff In .h File/.
|
|
class Button {
|
|
public:
|
|
Button(int x, int y, int w, int h);
|
|
|
|
void handleEvent(const SDL_Event& e);
|
|
void update();
|
|
void render(SDL_Renderer* render);
|
|
|
|
bool isHovered();
|
|
bool isPressed();
|
|
bool isClicked();
|
|
|
|
private:
|
|
SDL_Rect rect;
|
|
bool hovered;
|
|
bool pressed;
|
|
bool clicked;
|
|
|
|
void updateHover(int mouseX, int mouseY);
|
|
|
|
};
|
|
|
|
|
|
#endif
|