summaryrefslogtreecommitdiff
path: root/source/platform
diff options
context:
space:
mode:
Diffstat (limited to 'source/platform')
-rw-r--r--source/platform/platform.c12
-rw-r--r--source/platform/platform.h56
-rw-r--r--source/platform/platform_include.h7
3 files changed, 75 insertions, 0 deletions
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 @@
1internal inline void
2sleep_ms(long ms)
3{
4 struct timespec ts;
5 ts.tv_sec = ms / 1000;
6 ts.tv_nsec = (ms % 1000) * 1000000L;
7
8 while (nanosleep(&ts, &ts))
9 {
10 NULL;
11 }
12}
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 @@
1#ifndef PLATFORM_H
2#define PLATFORM_H
3
4#define NIL 0
5
6#include <X11/X.h>
7#include <X11/Xlib.h>
8 #include <X11/keysym.h>
9#include <time.h>
10#include <unistd.h>
11
12typedef struct WindowProperties WindowProperties;
13struct WindowProperties
14{
15 i32 x;
16 i32 y;
17 u32 height;
18 u32 width;
19 u32 border_width;
20 i32 window_depth;
21 u32 window_class;
22 u64 value_mask;
23
24};
25
26typedef struct vertex vertex;
27
28struct vertex
29{
30 i32 x;
31 i32 y;
32 i32 z;
33};
34
35typedef struct display_pos display_pos;
36
37struct display_pos
38{
39 i32 x;
40 i32 y;
41
42};
43
44typedef struct pos pos;
45struct pos
46{
47 i32 x;
48 i32 y;
49 i32 z;
50
51} ;
52
53
54
55
56#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 @@
1#ifndef PLATFORM_INCLUDE_H
2#define PLATFORM_INCLUDE_H
3
4#include "platform.h"
5#include "platform.c"
6
7#endif /* PLATFORM_INCLUDE_H */