From fc0e3524feff1da002e428c02a4eb988f560ada3 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Mon, 15 Jan 2024 20:03:25 +0000 Subject: [PATCH] Add window ID --- include/window.h | 1 + src/window.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/window.h b/include/window.h index 23c6f05..7818c05 100644 --- a/include/window.h +++ b/include/window.h @@ -36,6 +36,7 @@ struct rect { }; struct window { + u32 id; u64 width; u64 height; const char *title; diff --git a/src/window.c b/src/window.c index 3d398e7..f265dd3 100644 --- a/src/window.c +++ b/src/window.c @@ -20,6 +20,7 @@ bool init_window(window_t *wnd, const char *title, u64 width, u64 height) { return false; } + wnd->id = SDL_GetWindowID(wnd->window); wnd->title = title; wnd->width = width; wnd->height = height; @@ -38,7 +39,7 @@ void cleanup_window(window_t *wnd) { wnd->window = NULL; } - wnd->width = wnd->height = 0; + wnd->width = wnd->height = wnd->id = 0; } void set_colour(const window_t *wnd, colour_t colour) {