From 444bfa2f41143aff7490e4fa21565947565b7d30 Mon Sep 17 00:00:00 2001 From: nasr Date: Fri, 13 Mar 2026 22:31:21 +0100 Subject: cleanup: generalisation --- source/platform/platform.c | 12 ++++++++ source/platform/platform.h | 56 ++++++++++++++++++++++++++++++++++++++ source/platform/platform_include.h | 7 +++++ 3 files changed, 75 insertions(+) create mode 100644 source/platform/platform.c create mode 100644 source/platform/platform.h create mode 100644 source/platform/platform_include.h (limited to 'source/platform') diff --git a/source/platform/platform.c b/source/platform/platform.c new file mode 100644 index 0000000..2e7bbad --- /dev/null +++ b/source/platform/platform.c @@ -0,0 +1,12 @@ +internal inline void +sleep_ms(long ms) +{ + struct timespec ts; + ts.tv_sec = ms / 1000; + ts.tv_nsec = (ms % 1000) * 1000000L; + + while (nanosleep(&ts, &ts)) + { + NULL; + } +} diff --git a/source/platform/platform.h b/source/platform/platform.h new file mode 100644 index 0000000..da8e065 --- /dev/null +++ b/source/platform/platform.h @@ -0,0 +1,56 @@ +#ifndef PLATFORM_H +#define PLATFORM_H + +#define NIL 0 + +#include +#include + #include +#include +#include + +typedef struct WindowProperties WindowProperties; +struct WindowProperties +{ + i32 x; + i32 y; + u32 height; + u32 width; + u32 border_width; + i32 window_depth; + u32 window_class; + u64 value_mask; + +}; + +typedef struct vertex vertex; + +struct vertex +{ + i32 x; + i32 y; + i32 z; +}; + +typedef struct display_pos display_pos; + +struct display_pos +{ + i32 x; + i32 y; + +}; + +typedef struct pos pos; +struct pos +{ + i32 x; + i32 y; + i32 z; + +} ; + + + + +#endif /* PLATFORM_H */ diff --git a/source/platform/platform_include.h b/source/platform/platform_include.h new file mode 100644 index 0000000..886c6b8 --- /dev/null +++ b/source/platform/platform_include.h @@ -0,0 +1,7 @@ +#ifndef PLATFORM_INCLUDE_H +#define PLATFORM_INCLUDE_H + +#include "platform.h" +#include "platform.c" + +#endif /* PLATFORM_INCLUDE_H */ -- cgit v1.3