EditorSDL
This commit is contained in:
33
editor/button.h~
Normal file
33
editor/button.h~
Normal file
@@ -0,0 +1,33 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user