From 18eb8a07ba39a8aad1c75521cee027b9c9c72e40 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 00:58:20 +0100 Subject: clang-format --- src/platform.cc | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/platform.cc') diff --git a/src/platform.cc b/src/platform.cc index 04bbf09..ff45964 100644 --- a/src/platform.cc +++ b/src/platform.cc @@ -7,11 +7,11 @@ #include -static GLFWwindow *window = nullptr; +static GLFWwindow* window = nullptr; static int windowed_x, windowed_y, windowed_w, windowed_h; static bool g_is_fullscreen = false; -static void glfw_key_callback(GLFWwindow *cb_window, int key, int scancode, +static void glfw_key_callback(GLFWwindow* cb_window, int key, int scancode, int action, int mods) { if (action == GLFW_PRESS) { if (key == GLFW_KEY_ESCAPE || key == GLFW_KEY_Q) { @@ -34,8 +34,8 @@ void platform_init_window(bool fullscreen) { glfwGetWindowPos(window, &windowed_x, &windowed_y); glfwGetWindowSize(window, &windowed_w, &windowed_h); - GLFWmonitor *monitor = glfwGetPrimaryMonitor(); - const GLFWvidmode *mode = glfwGetVideoMode(monitor); + GLFWmonitor* monitor = glfwGetPrimaryMonitor(); + const GLFWvidmode* mode = glfwGetVideoMode(monitor); glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate); } @@ -46,9 +46,13 @@ void platform_shutdown() { glfwTerminate(); } -void platform_poll() { glfwPollEvents(); } +void platform_poll() { + glfwPollEvents(); +} -bool platform_should_close() { return glfwWindowShouldClose(window); } +bool platform_should_close() { + return glfwWindowShouldClose(window); +} void platform_toggle_fullscreen() { g_is_fullscreen = !g_is_fullscreen; @@ -56,8 +60,8 @@ void platform_toggle_fullscreen() { glfwGetWindowPos(window, &windowed_x, &windowed_y); glfwGetWindowSize(window, &windowed_w, &windowed_h); - GLFWmonitor *monitor = glfwGetPrimaryMonitor(); - const GLFWvidmode *mode = glfwGetVideoMode(monitor); + GLFWmonitor* monitor = glfwGetPrimaryMonitor(); + const GLFWvidmode* mode = glfwGetVideoMode(monitor); glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate); } else { @@ -66,9 +70,13 @@ void platform_toggle_fullscreen() { } } -GLFWwindow *platform_get_window() { return window; } +GLFWwindow* platform_get_window() { + return window; +} -double platform_get_time() { return glfwGetTime(); } +double platform_get_time() { + return glfwGetTime(); +} WGPUSurface platform_create_wgpu_surface(WGPUInstance instance) { return glfwCreateWindowWGPUSurface(instance, window); -- cgit v1.2.3