summaryrefslogtreecommitdiff
path: root/src/platform.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-01 00:58:20 +0100
committerskal <pascal.massimino@gmail.com>2026-02-01 01:13:53 +0100
commit18eb8a07ba39a8aad1c75521cee027b9c9c72e40 (patch)
tree87e498dbaffdd591eb94fddca315f6ba28756a32 /src/platform.cc
parent03cd94817097e59a0809b222e0e1e74dd9a8ede7 (diff)
clang-format
Diffstat (limited to 'src/platform.cc')
-rw-r--r--src/platform.cc28
1 files changed, 18 insertions, 10 deletions
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 <GLFW/glfw3.h>
-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);