dont serialize meta flag, wasm work
This commit is contained in:
@@ -1,29 +1,65 @@
|
||||
#include "core/core_inc.h"
|
||||
#include "app/app.h"
|
||||
#include "os/os.h"
|
||||
|
||||
#include "core/core_inc.c"
|
||||
#include "app/app.c"
|
||||
#include "os/os.c"
|
||||
#include "gfx2d/gfx2d.c"
|
||||
|
||||
// #include "ui.c"
|
||||
|
||||
gfx_t *gfx = NULL;
|
||||
typedef struct ui_widget_t ui_widget_t;
|
||||
struct ui_widget_t {
|
||||
};
|
||||
|
||||
typedef struct ui_t ui_t;
|
||||
struct ui_t {
|
||||
|
||||
// update cycle data
|
||||
b8 left_press;
|
||||
b8 left_unpress;
|
||||
b8 left_down;
|
||||
v2f64_t mouse_pos;
|
||||
v2f64_t window_size;
|
||||
|
||||
//
|
||||
|
||||
};
|
||||
|
||||
gb ui_t gb_ui = {0};
|
||||
gb gfx_t *gfx = NULL;
|
||||
|
||||
gb i32 config_indent = 4;
|
||||
|
||||
void ui_begin_interaction(ui_t *ui, app_event_t *ev) {
|
||||
ui->mouse_pos = ev->mouse_pos;
|
||||
ui->window_size = ev->window_size;
|
||||
ui->left_press = false;
|
||||
ui->left_unpress = false;
|
||||
if (ev->kind == app_event_kind_mouse_down && ev->mouse_button == app_mouse_button_left) {
|
||||
ui->left_press = true;
|
||||
ui->left_down = true;
|
||||
}
|
||||
if (ev->kind == app_event_kind_mouse_up && ev->mouse_button == app_mouse_button_left) {
|
||||
ui->left_unpress = true;
|
||||
ui->left_down = false;
|
||||
}
|
||||
}
|
||||
|
||||
void app_handle_event(app_event_t *ev) {
|
||||
ui_t *ui = &gb_ui;
|
||||
ui_begin_interaction(ui, ev);
|
||||
}
|
||||
|
||||
void app_init(void) {
|
||||
ma_arena_t *perm = &tcx._perm;
|
||||
gfx = ma_push_type(perm, gfx_t);
|
||||
|
||||
os_date_t ldate = os_local_time_now();
|
||||
os_date_t udate = os_universal_time_now();
|
||||
|
||||
assert(ldate.hour == (udate.hour + 1));
|
||||
}
|
||||
|
||||
b32 app_update(app_event_list_t events) {
|
||||
for (app_event_t *ev = events.first; ev; ev = ev->next) {
|
||||
// update
|
||||
app_handle_event(ev);
|
||||
}
|
||||
|
||||
// These steps should be totally optional!!
|
||||
|
||||
Reference in New Issue
Block a user