From e1b0ea16142beb29d2fbfdf4f02524eb117aee6d Mon Sep 17 00:00:00 2001 From: onelin Date: Thu, 18 Dec 2025 21:52:13 +0100 Subject: Add instance to window_init And make a mess in the meantime:( --- src/include/daw/platform_glfw.h | 4 +++- src/include/daw/window.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/daw/platform_glfw.h b/src/include/daw/platform_glfw.h index 8311c5a..a877261 100644 --- a/src/include/daw/platform_glfw.h +++ b/src/include/daw/platform_glfw.h @@ -10,7 +10,9 @@ extern "C" { #include #include -Window* window_init_glfw(const char *restrict windowtitle, ivec2 windowsize, const u32 flags); +struct Instance; + +Window* window_init_glfw(struct Instance *restrict instance, const char *restrict windowtitle, ivec2 windowsize, const u32 flags); void window_destroy_glfw(Window *restrict w); void window_resize_glfw(Window *restrict window, int width, int height); void window_size_glfw(Window *restrict w, ivec2 *restrict dst); diff --git a/src/include/daw/window.h b/src/include/daw/window.h index 3a4d1b0..3fe432d 100644 --- a/src/include/daw/window.h +++ b/src/include/daw/window.h @@ -16,6 +16,8 @@ extern "C" { #define DAW_WINDOW_FULLSCREEN (1 << 1) #define DAW_WINDOW_RESIZEABLE (1 << 2) +struct Instance; + typedef enum { WINDOW_FRAMEWORK_NONE = 0, WINDOW_FRAMEWORK_GLFW, @@ -67,7 +69,7 @@ struct Platform { * Returns: * A pointer to a struct Window, NULL on error. */ - Window* (*window_init)(const char *restrict title, ivec2 windowsize, const u32 flags); + Window* (*window_init)(struct Instance *restrict instance, const char *restrict title, ivec2 windowsize, const u32 flags); /* Destroy, close, and free up resources related to the window and the * platform library specific resources. -- cgit v1.3