rntviewer/src/window.h

34 lines
450 B
C
Raw Normal View History

2024-07-11 12:00:43 +00:00
enum Input_Key {
KEY_UP,
KEY_DOWN,
KEY_LEFT,
KEY_RIGHT,
KEY_Q,
KEY_ALT,
KEY_TAB,
KEY_COUNT
};
2024-07-16 15:58:01 +00:00
enum Key_State : u8 {
2024-07-11 12:00:43 +00:00
KEY_STATE_IS_DOWN = 0x1,
KEY_STATE_JUST_PRESSED = 0x2,
KEY_STATE_JUST_RELEASED = 0x4,
};
struct User_Input {
2024-07-16 15:58:01 +00:00
u8 key_state[KEY_COUNT];
2024-07-11 12:00:43 +00:00
struct { i32 x; i32 y; } mouse_pos;
};
struct Window_Data {
// Real width and height of the window
i32 width;
i32 height;
bool size_just_changed;
f32 desired_aspect_ratio;
};