implement our own gui module, drop microui
This commit is contained in:
parent
2555bec8eb
commit
8baf5f06ea
25 changed files with 495 additions and 507 deletions
38
src/pxl8_gui.h
Normal file
38
src/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_begin_frame(pxl8_gui_state* state);
|
||||
void pxl8_gui_end_frame(pxl8_gui_state* state);
|
||||
|
||||
void pxl8_gui_cursor_move(pxl8_gui_state* state, i32 x, i32 y);
|
||||
void pxl8_gui_cursor_down(pxl8_gui_state* state);
|
||||
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_window(pxl8_gfx* gfx, i32 x, i32 y, i32 w, i32 h, const char* title);
|
||||
void pxl8_gui_label(pxl8_gfx* gfx, i32 x, i32 y, const char* text, u8 color);
|
||||
|
||||
bool pxl8_gui_is_hovering(const pxl8_gui_state* state);
|
||||
void pxl8_gui_get_cursor_pos(const pxl8_gui_state* state, i32* x, i32* y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue