- [NEW] Pasada la textura de font a png
- [FIX] debugger inicialitzat al començar - [WIP] Noves classes de UI
This commit is contained in:
1 parent
1dddc11722
commit
6c205fb014
7 files changed
+255
-1
No files matched your search
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "context.h"
|
||||
#include <vector>
|
||||
|
||||
namespace ui
|
||||
{
|
||||
enum MouseButton { mbLeft = 0, mbMiddle = 1, mbRight = 2 };
|
||||
enum MouseButtonState { mbsReleased, mbsDown, mbsPressed, mbsUp };
|
||||
struct Input {
|
||||
struct {
|
||||
int x, y;
|
||||
MouseButtonState buttons[3] = {mbsReleased, mbsReleased, mbsReleased};
|
||||
} mouse;
|
||||
struct {
|
||||
uint8_t keyDown = 0;
|
||||
uint8_t keyUp = 0;
|
||||
const bool *keys;
|
||||
} keyboard;
|
||||
};
|
||||
|
||||
class Window {
|
||||
public:
|
||||
|
||||
Window(const char *title, int width, int height);
|
||||
~Window();
|
||||
|
||||
bool HandleEvents(SDL_Event *e);
|
||||
|
||||
static void DistributeEvent(SDL_Event *e);
|
||||
|
||||
protected:
|
||||
SDL_Window *win;
|
||||
Context *context;
|
||||
Input input;
|
||||
|
||||
static std::vector<std::pair<uint32_t, Window*>> windows;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user