summaryrefslogtreecommitdiff
path: root/src/wayclock.cc
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-11 21:36:49 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-11 21:36:49 +0100
commit29805da671f7dd13f9e1b25800ac6a846391d355 (patch)
tree84ad3175240528a5e739fed896950f1dc4b2a245 /src/wayclock.cc
parent8c4b2e65c08ce0814e4d8059fc4df7c731b07ca5 (diff)
fixing use method
Diffstat (limited to 'src/wayclock.cc')
-rw-r--r--src/wayclock.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/wayclock.cc b/src/wayclock.cc
index e8879f4..43f07ab 100644
--- a/src/wayclock.cc
+++ b/src/wayclock.cc
@@ -22,16 +22,16 @@ struct app_s {
struct atlas_s* atlas;
};
-void wayc_frame(struct renderer_s* renderer, struct window_s* window,
+void wayc_frame(struct app_s* app, struct window_s* window,
struct eventloop_s* loop) {
wayc_notnull(window);
wayc_notnull(loop);
- wayc_notnull(renderer);
+ wayc_notnull(app);
- glClearColor(0.1f, 0.2f, 0.2f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
+ wayc_atlas_use(app->atlas, 0);
- wayc_renderer_swap(renderer);
+ wayc_renderer_swap(app->renderer);
}
void wayc_handle(u8* user, struct eventloop_s* loop, struct event_s* event) {
@@ -53,7 +53,7 @@ void wayc_handle(u8* user, struct eventloop_s* loop, struct event_s* event) {
wayc_renderer_resize(renderer, resize.width, resize.height);
} break;
case EVENT_KIND_FRAME:
- wayc_frame(renderer, window, loop);
+ wayc_frame(app, window, loop);
break;
default:
break;
@@ -103,7 +103,9 @@ int main() {
wayc_panic("Failed to initialize renderer");
wayc_defer(wayc_renderer_deinit(&renderer));
+
wayc_renderer_use(&renderer);
+ glClearColor(0.1f, 0.2f, 0.2f, 1.0f);
struct atlas_s atlas;
if (!wayc_atlas_init(&atlas, WAYC_ATLAS_WIDTH, WAYC_ATLAS_HEIGHT))