refactor: reorganize pxl8 into client/src/ module structure
- core/: main entry, types, logging, I/O, RNG - asset/: ase loader, cart, save, embed - gfx/: graphics, animation, atlas, fonts, tilemap, transitions - sfx/: audio - script/: lua/fennel runtime, REPL - hal/: platform abstraction (SDL3) - world/: BSP, world, procedural gen - math/: math utilities - game/: GUI, replay - lua/: Lua API modules
This commit is contained in:
parent
272e0bc615
commit
39b604b333
106 changed files with 6078 additions and 3715 deletions
38
client/src/game/pxl8_gui.h
Normal file
38
client/src/game/pxl8_gui.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include "pxl8_gfx.h"
|
||||
#include "pxl8_types.h"
|
||||
|
||||
typedef struct {
|
||||
i32 cursor_x;
|
||||
i32 cursor_y;
|
||||
bool cursor_down;
|
||||
bool cursor_clicked;
|
||||
u32 hot_id;
|
||||
u32 active_id;
|
||||
} pxl8_gui_state;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
pxl8_gui_state* pxl8_gui_state_create(void);
|
||||
void pxl8_gui_state_destroy(pxl8_gui_state* state);
|
||||
|
||||
void pxl8_gui_get_cursor_pos(const pxl8_gui_state* state, i32* x, i32* y);
|
||||
bool pxl8_gui_is_hovering(const pxl8_gui_state* state);
|
||||
|
||||
void pxl8_gui_begin_frame(pxl8_gui_state* state);
|
||||
void pxl8_gui_end_frame(pxl8_gui_state* state);
|
||||
|
||||
void pxl8_gui_cursor_down(pxl8_gui_state* state);
|
||||
void pxl8_gui_cursor_move(pxl8_gui_state* state, i32 x, i32 y);
|
||||
void pxl8_gui_cursor_up(pxl8_gui_state* state);
|
||||
|
||||
bool pxl8_gui_button(pxl8_gui_state* state, pxl8_gfx* gfx, u32 id, i32 x, i32 y, i32 w, i32 h, const char* label);
|
||||
void pxl8_gui_label(pxl8_gfx* gfx, i32 x, i32 y, const char* text, u8 color);
|
||||
void pxl8_gui_window(pxl8_gfx* gfx, i32 x, i32 y, i32 w, i32 h, const char* title);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue