summaryrefslogtreecommitdiff
path: root/src/wayclock.cc
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-11 21:27:25 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-11 21:27:25 +0100
commit600c704e09dc24ea259fc72c63287d07a0a4bd39 (patch)
tree7c866dc5cedacbf176d4014f69bc0cdd1f098715 /src/wayclock.cc
parentf6a9ffd92b8470a32fb4ebd6342dea4b9539f586 (diff)
working on atlas
Diffstat (limited to 'src/wayclock.cc')
-rw-r--r--src/wayclock.cc16
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);