diff options
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); |
