win32 drawing text
This commit is contained in:
@@ -3,7 +3,13 @@
|
||||
|
||||
#include "core/core_inc.c"
|
||||
#include "app/app.c"
|
||||
#include "gfx2d/gfx2d.c"
|
||||
|
||||
#define STB_TRUETYPE_IMPLEMENTATION
|
||||
#include "render/stb_truetype.h"
|
||||
#include "render/backup_font.c"
|
||||
#include "render/font.c"
|
||||
#include "render/render_opengl.c"
|
||||
// #include "gfx2d/gfx2d.c"
|
||||
|
||||
#include "ui.c"
|
||||
|
||||
@@ -19,7 +25,7 @@
|
||||
|
||||
typedef struct globals_t globals_t;
|
||||
struct globals_t {
|
||||
gfx_t *gfx;
|
||||
// gfx_t *gfx;
|
||||
app_event_t event;
|
||||
};
|
||||
gb globals_t *globals;
|
||||
@@ -30,28 +36,11 @@ fn void app_init(void) {
|
||||
|
||||
ma_arena_t *perm = &tcx._perm;
|
||||
globals = ma_push_type(perm, globals_t);
|
||||
globals->gfx = ma_push_type(perm, gfx_t);
|
||||
// globals->gfx = ma_push_type(perm, gfx_t);
|
||||
rn_init(perm);
|
||||
ui_init(perm);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
ui_begin_expander("app_event_t");
|
||||
{
|
||||
ui_edit_enum("kind: app_event_kind_t = %S");
|
||||
|
||||
ui_begin_expander("mouse_wheel_delta: v3f64_t");
|
||||
{
|
||||
ui_edit_f64(&x, "x: %f", x);
|
||||
ui_edit_f64(&y, "y: %f", y);
|
||||
ui_edit_f64(&z, "z: %f", z);
|
||||
}
|
||||
ui_end_expander();
|
||||
}
|
||||
ui_end_expander();
|
||||
#endif
|
||||
|
||||
|
||||
fn b32 app_update(app_event_list_t events) {
|
||||
ui_begin_frame();
|
||||
defer_block(ui_begin_build(), ui_end_build()) {
|
||||
@@ -104,6 +93,15 @@ fn b32 app_update(app_event_list_t events) {
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
app_event_t *ev = events.last;
|
||||
rn_begin(v2f64_to_v2f32(ev->window_size));
|
||||
rn_base_draw_string(&rn_state.main_font, s8_lit("hello world!"), v2f32(0,0), black_color_global, true);
|
||||
rn_end(v2f64_to_v2f32(ev->window_size), white_color_global);
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
// These steps should be totally optional!!
|
||||
{
|
||||
app_event_t *ev = events.last;
|
||||
@@ -137,6 +135,7 @@ fn b32 app_update(app_event_list_t events) {
|
||||
ui_draw(globals->gfx);
|
||||
gfx_end(globals->gfx);
|
||||
}
|
||||
#endif
|
||||
|
||||
ui_end_frame();
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user