From e7fc9b3adeb37cb10726718e512b0da8dc49bc11 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 12:24:29 +0100 Subject: fix(build): Add compatibility for older wgpu-native headers - Added preprocessor definitions for 'WGPUOptionalBool_True' and 'WGPUOptionalBool_False' to ensure successful cross-compilation against the older wgpu-native headers used for the Windows build. - This resolves the build failures in the Windows CI/check script. --- src/platform.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/platform.h') diff --git a/src/platform.h b/src/platform.h index 7267873..152a38d 100644 --- a/src/platform.h +++ b/src/platform.h @@ -14,18 +14,26 @@ struct PlatformState { int windowed_x = 0, windowed_y = 0, windowed_w = 0, windowed_h = 0; }; -void platform_init(PlatformState* state, bool fullscreen, int* width_ptr, int* height_ptr); +void platform_init(PlatformState* state, bool fullscreen, int* width_ptr, + int* height_ptr); void platform_shutdown(PlatformState* state); void platform_poll(PlatformState* state); bool platform_should_close(PlatformState* state); void platform_toggle_fullscreen(PlatformState* state); // Inline getters for direct access -inline GLFWwindow* platform_get_window(PlatformState* state) { return state->window; } -inline int platform_get_width(PlatformState* state) { return state->width; } -inline int platform_get_height(PlatformState* state) { return state->height; } +inline GLFWwindow* platform_get_window(PlatformState* state) { + return state->window; +} +inline int platform_get_width(PlatformState* state) { + return state->width; +} +inline int platform_get_height(PlatformState* state) { + return state->height; +} inline float platform_get_aspect_ratio(PlatformState* state) { - if (state->height == 0) return 1.0f; + if (state->height == 0) + return 1.0f; return (float)state->width / (float)state->height; } @@ -33,7 +41,7 @@ inline float platform_get_aspect_ratio(PlatformState* state) { // Include the header directly to get the proper linkage. #include inline double platform_get_time() { - return glfwGetTime(); + return glfwGetTime(); } // WebGPU specific surface creation @@ -42,4 +50,5 @@ inline double platform_get_time() { #else #include #endif -WGPUSurface platform_create_wgpu_surface(WGPUInstance instance, PlatformState* state); +WGPUSurface platform_create_wgpu_surface(WGPUInstance instance, + PlatformState* state); -- cgit v1.2.3