QuasarEngine
Cross-platform 3D engine and editor
Toggle main menu visibility
Loading...
Searching...
No Matches
PlatformDetection.h
Go to the documentation of this file.
1
#pragma once
2
14
15
#if defined(__linux__)
16
#define QUASAR_PLATFORM_LINUX
17
#elif defined(_WIN32)
18
#define QUASAR_PLATFORM_WINDOWS
19
#elif defined(__APPLE__)
20
#error "MacOS is not supported !"
21
#else
22
#error "Current platform is not supported !"
23
#endif
24
25
#ifdef NDEBUG
26
#define QUASAR_RELEASE
27
#else
28
#define QUASAR_DEBUG
29
#endif
30
31
namespace
Quasar
32
{
36
class
PlatformDetection
37
{
38
public
:
40
static
constexpr
bool
IsWindows
()
41
{
42
#ifdef QUASAR_PLATFORM_WINDOWS
43
return
true
;
44
#else
45
return
false
;
46
#endif
47
}
48
50
static
constexpr
bool
IsLinux
()
51
{
52
#ifdef QUASAR_PLATFORM_LINUX
53
return
true
;
54
#else
55
return
false
;
56
#endif
57
}
58
60
static
constexpr
bool
IsDebug
()
61
{
62
#ifdef QUASAR_DEBUG
63
return
true
;
64
#else
65
return
false
;
66
#endif
67
}
68
70
static
constexpr
bool
IsRelease
()
71
{
72
#ifdef QUASAR_RELEASE
73
return
true
;
74
#else
75
return
false
;
76
#endif
77
}
78
};
79
}
Quasar::PlatformDetection
Tells at compile time which platform and build type the engine is built for.
Definition
PlatformDetection.h:37
Quasar::PlatformDetection::IsLinux
static constexpr bool IsLinux()
Returns true when the engine is built for Linux.
Definition
PlatformDetection.h:50
Quasar::PlatformDetection::IsWindows
static constexpr bool IsWindows()
Returns true when the engine is built for Windows.
Definition
PlatformDetection.h:40
Quasar::PlatformDetection::IsDebug
static constexpr bool IsDebug()
Returns true in a Debug build.
Definition
PlatformDetection.h:60
Quasar::PlatformDetection::IsRelease
static constexpr bool IsRelease()
Returns true in a Release build.
Definition
PlatformDetection.h:70
Quasar
Contains all the engine code.
quasar
core
PlatformDetection.h
Generated by
1.18.0