SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
OSDef.hpp
Go to the documentation of this file.
1#ifndef _OSDEF_H_
2#define _OSDEF_H_
3
4/* Windows x86/x64 */
5#ifdef _WIN32
6 #ifdef SLEAK_EXPORTS
7 #define SLEAK_API __declspec(dllexport)
8 #else
9 #define SLEAK_API __declspec(dllimport)
10 #endif
11
12 #ifdef SLEAK_ENGINE
13 #define ENGINE_API __declspec(dllexport)
14 #else
15 #define ENGINE_API __declspec(dllimport)
16 #endif
17
18 /* Windows x64 */
19 #ifdef _WIN64
20 #define PLATFORM_WIN
21 #define OS "windows"
22 #define WINDOW_SYSTEM "dwm"
23 /* Windows x86 */
24 #else
25 #error "x86 architecture is not supported for this program!"
26 #endif
27
28 /* MacOS/Iphone */
29#elif defined(__IOS__) || defined(__APPLE__) || defined(__MACH__)
30 #define PLATFORM_IOS
31 #define OS "ios"
32 #define WINDOW_SYSTEM "quartz"
33 #define SLEAK_API
34 #define ENGINE_API
35
36/* Android devices (need to be defined before linux) */
37#elif defined(__ANDROID__)
38 #define PLATFORM_ANDROID
39 #define OS "android"
40 #define WINDOW_SYSTEM "surfaceflinger"
41 #define SLEAK_API
42 #define ENGINE_API
43
44/* Berkley Software Distribution */
45#elif defined(__FreeBSD__)
46 #error "FreeBSD not supported yet"
47/* Linux and all distros */
48#elif defined(__linux__)
49 #define PLATFORM_LINUX
50 #define OS "linux"
51 #define WINDOW_SYSTEM std::getenv("XDG_SESSION_TYPE")
52 #define SLEAK_API
53 #define ENGINE_API
54
55#else
56 #error "Undefined OS"
57
58#endif
59
60#define MACRO_STR(macro) #macro
61
62#define RESOURCE(path) R"(assets/textures/" path ")"
63
64#include <Core/Logger.hpp>
65
66#endif