diff options
| author | nasr <nsrddyn@gmail.com> | 2026-10-09 12:37:56 +0200 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-10-09 12:37:56 +0200 |
| commit | 9a2fe3e091849518f3d2f79114ba67fa4fc63adf (patch) | |
| tree | 62678a2ff13752d8f8916aca8b6ff70d9bbd6d80 /source/base/base_include.h | |
| parent | e467661baf3d035fb4726559abee52a0c8897ab0 (diff) | |
feature: window with sqaures etc etcmain
Diffstat (limited to 'source/base/base_include.h')
| -rw-r--r-- | source/base/base_include.h | 69 |
1 files changed, 48 insertions, 21 deletions
diff --git a/source/base/base_include.h b/source/base/base_include.h index 401f682..22727f5 100644 --- a/source/base/base_include.h +++ b/source/base/base_include.h | |||
| @@ -1,47 +1,70 @@ | |||
| 1 | #ifndef BASE_INCLUDE_H | 1 | #ifndef BASE_INCLUDE_H |
| 2 | #define BASE_INCLUDE_H | 2 | #define BASE_INCLUDE_H |
| 3 | 3 | ||
| 4 | #if defined(__linux__) || defined(__APPLE__) | 4 | #if defined(__APPLE__) |
| 5 | // #message "PLATFORM LINUX APPLE" | 5 | #define PLATFORM_APPLE 1 |
| 6 | #define PLATFORM_UNIX 1 | 6 | #define PLATFORM_UNIX 1 |
| 7 | #elif defined(__linux__) | ||
| 7 | #define PLATFORM_LINUX 1 | 8 | #define PLATFORM_LINUX 1 |
| 8 | #elif defined(__linux__) && !defined(__APPLE__) | 9 | #define PLATFORM_UNIX 1 |
| 9 | #message "PLATFORM LINUX" | 10 | #elif defined(_WIN32) |
| 10 | #define PLATFORM_LINUX 1 | ||
| 11 | #elif defined(_WIN32) || defined(_WIN64) | ||
| 12 | #message "PLATFORM WINDOWS" | ||
| 13 | #define PLATFORM_WINDOWS 1 | 11 | #define PLATFORM_WINDOWS 1 |
| 14 | #elif defined(__APPLE__) | ||
| 15 | #define PLATFORM_APPLE 1 | ||
| 16 | #message "PLATFORM APPLE" | ||
| 17 | #else | 12 | #else |
| 18 | #message platform unknown | 13 | #error Unsupported platform |
| 19 | #endif // platform definitions | 14 | #endif // platform definitions |
| 20 | 15 | ||
| 16 | #ifndef PLATFORM_APPLE | ||
| 17 | #define PLATFORM_APPLE 0 | ||
| 18 | #endif | ||
| 19 | #ifndef PLATFORM_LINUX | ||
| 20 | #define PLATFORM_LINUX 0 | ||
| 21 | #endif | ||
| 22 | #ifndef PLATFORM_UNIX | ||
| 23 | #define PLATFORM_UNIX 0 | ||
| 24 | #endif | ||
| 25 | #ifndef PLATFORM_WINDOWS | ||
| 26 | #define PLATFORM_WINDOWS 0 | ||
| 27 | #endif | ||
| 28 | #ifndef DEBUG | ||
| 29 | #define DEBUG 0 | ||
| 30 | #endif | ||
| 31 | #ifndef X11 | ||
| 32 | #define X11 0 | ||
| 33 | #endif | ||
| 34 | #ifndef WAYLAND | ||
| 35 | #define WAYLAND 0 | ||
| 36 | #endif | ||
| 37 | #ifndef VULKAN | ||
| 38 | #define VULKAN 0 | ||
| 39 | #endif | ||
| 40 | #ifndef OPENGL | ||
| 41 | #define OPENGL 0 | ||
| 42 | #endif | ||
| 43 | |||
| 21 | #if PLATFORM_UNIX | 44 | #if PLATFORM_UNIX |
| 22 | #include <unistd.h> | 45 | #include <unistd.h> |
| 23 | #include <dirent.h> | 46 | #include <dirent.h> |
| 24 | #include <sys/syscall.h> | ||
| 25 | #include <sys/mman.h> | 47 | #include <sys/mman.h> |
| 26 | #include <sys/socket.h> // needed for making a connection to displays (wayland) | 48 | #include <sys/socket.h> // needed for making a connection to displays (wayland) |
| 27 | #include <sys/stat.h> | 49 | #include <sys/stat.h> |
| 28 | #include <sys/types.h> | ||
| 29 | #include <sys/un.h> | 50 | #include <sys/un.h> |
| 30 | #include <fcntl.h> | 51 | #include <fcntl.h> |
| 31 | #include <dlfcn.h> | 52 | #include <dlfcn.h> |
| 32 | 53 | ||
| 33 | #if DEBUG | ||
| 34 | #include <errno.h> | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #if PLATFORM_LINUX | 54 | #if PLATFORM_LINUX |
| 38 | 55 | ||
| 56 | #include <linux/input-event-codes.h> | ||
| 57 | |||
| 39 | #if X11 | 58 | #if X11 |
| 40 | #include <X11/X.h> | 59 | #include <X11/X.h> |
| 41 | #include <X11/Xlib.h> | 60 | #include <X11/Xlib.h> |
| 42 | #include <X11/keysym.h> | 61 | #include <X11/keysym.h> |
| 43 | #elif WAYLAND | 62 | #elif WAYLAND |
| 44 | #include <wayland-client.h> | 63 | |
| 64 | |||
| 65 | #include <wayland-client.h> // wl_display, wl_surface, wl_seat, wl_keyboard, ... (core protocol) | ||
| 66 | #include "xdg-shell-client-protocol.h" // xdg_wm_base, xdg_surface, xdg_toplevel (generated by build.sh) | ||
| 67 | #include <xkbcommon/xkbcommon.h> // the only types of inputs the server will probably send on wayland | ||
| 45 | #endif | 68 | #endif |
| 46 | 69 | ||
| 47 | #endif // PLATFORM_LINUX | 70 | #endif // PLATFORM_LINUX |
| @@ -59,12 +82,11 @@ | |||
| 59 | //- | 82 | //- |
| 60 | 83 | ||
| 61 | #include <time.h> | 84 | #include <time.h> |
| 62 | #include <math.h> | ||
| 63 | #include <string.h> | 85 | #include <string.h> |
| 64 | #include <stdint.h> | 86 | #include <stdint.h> |
| 65 | #include <stddef.h> | ||
| 66 | #include <stdio.h> | 87 | #include <stdio.h> |
| 67 | #include <stdarg.h> | 88 | #include <stdarg.h> |
| 89 | #include <errno.h> | ||
| 68 | 90 | ||
| 69 | //- | 91 | //- |
| 70 | #include "base_core.h" | 92 | #include "base_core.h" |
| @@ -80,7 +102,12 @@ | |||
| 80 | #include "base_arena.cpp" | 102 | #include "base_arena.cpp" |
| 81 | #include "base_stack.cpp" | 103 | #include "base_stack.cpp" |
| 82 | #include "base_string.cpp" | 104 | #include "base_string.cpp" |
| 83 | #include "base_platform.cpp" | 105 | |
| 106 | #if PLATFORM_LINUX | ||
| 107 | #include "base_platform_linux.cpp" | ||
| 108 | #elif PLATFORM_WINDOWS | ||
| 109 | #include "base_platform_win32.cpp" | ||
| 110 | #endif | ||
| 84 | 111 | ||
| 85 | #include "base_rand.cpp" | 112 | #include "base_rand.cpp" |
| 86 | #include "base_simd.cpp" | 113 | #include "base_simd.cpp" |
