diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-02 12:24:29 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-02 12:24:29 +0100 |
| commit | e7fc9b3adeb37cb10726718e512b0da8dc49bc11 (patch) | |
| tree | d46b2877cc17692515c9dfe90c67417c6639e4ae /src/platform.h | |
| parent | 053b29d162e7b157cecbfcd214005a961103ad67 (diff) | |
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.
Diffstat (limited to 'src/platform.h')
| -rw-r--r-- | src/platform.h | 23 |
1 files changed, 16 insertions, 7 deletions
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 <GLFW/glfw3.h> inline double platform_get_time() { - return glfwGetTime(); + return glfwGetTime(); } // WebGPU specific surface creation @@ -42,4 +50,5 @@ inline double platform_get_time() { #else #include <wgpu.h> #endif -WGPUSurface platform_create_wgpu_surface(WGPUInstance instance, PlatformState* state); +WGPUSurface platform_create_wgpu_surface(WGPUInstance instance, + PlatformState* state); |
