diff options
Diffstat (limited to 'src/wayclock.cc')
| -rw-r--r-- | src/wayclock.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/wayclock.cc b/src/wayclock.cc index 0852176..84a188e 100644 --- a/src/wayclock.cc +++ b/src/wayclock.cc @@ -3,6 +3,7 @@ #include "events.h" #include "glad.h" #include "graphics.h" +#include "rendering.h" #include "text.h" #include "utils.h" #include "window.h" @@ -11,10 +12,14 @@ #define WAYC_APP_WIDTH 1280 #define WAYC_APP_HEIGHT 1080 #define WAYC_FONT "AdwaitaMono-Regular.ttf" +#define WAYC_ATLAS_WIDTH 512 +#define WAYC_ATLAS_HEIGHT 512 struct app_s { struct renderer_s* renderer; struct font_context_s* fctx; + struct font_s* font; + struct atlas_s* atlas; }; void wayc_frame(struct renderer_s* renderer, struct window_s* window, @@ -68,6 +73,12 @@ int main() { wayc_defer(wayc_font_deinit(&font)); + struct atlas_s atlas; + if (!wayc_atlas_init(&atlas, WAYC_ATLAS_WIDTH, WAYC_ATLAS_HEIGHT)) + wayc_panic("Failed to initialize atlas"); + + wayc_defer(wayc_atlas_deinit(&atlas)); + struct eventloop_s loop; if (wayc_eventloop_init(&loop, wayc_handle) != EVENTLOOP_ERROR_NONE) wayc_panic("Failed to initialize event loop"); @@ -102,10 +113,7 @@ int main() { wayc_renderer_use(&renderer); wayc_window_redraw(&window, &loop); - struct app_s app = { - &renderer, - &fctx, - }; + struct app_s app = {&renderer, &fctx, &font, &atlas}; while (wayc_eventloop_running(&loop)) { wayc_eventloop_update(&loop, (u8*)&app); |
