Polyphase Game Engine
Loading...
Searching...
No Matches
SystemTypes.h
Go to the documentation of this file.
1#pragma once
2
3#include "Constants.h"
4#include "Maths.h"
5#include <string>
6
7#if PLATFORM_WINDOWS
8#include <Windows.h>
9#elif PLATFORM_LINUX
10#include <stdio.h>
11#include <dirent.h>
12#include <sys/types.h>
13#include <sys/stat.h>
14#include <unistd.h>
15#include <xcb/xcb.h>
16#include <pthread.h>
17#elif PLATFORM_ANDROID
18#include <stdio.h>
19#include <dirent.h>
20#include <sys/types.h>
21#include <sys/stat.h>
22#include <unistd.h>
23#include <pthread.h>
24#include <android/native_window.h>
25#include <android/native_activity.h>
26#include <android_native_app_glue.h>
27#elif PLATFORM_DOLPHIN
28#include <gccore.h>
29#include <dirent.h>
30#include <sys/types.h>
31#include <sys/stat.h>
32#elif PLATFORM_3DS
33#include <3ds.h>
34#include <dirent.h>
35#include <sys/types.h>
36#include <sys/stat.h>
37#endif
38
39#if PLATFORM_WINDOWS
40typedef HANDLE ThreadObject;
41typedef HANDLE MutexObject;
42typedef DWORD ThreadFuncRet;
43#elif (PLATFORM_LINUX || PLATFORM_ANDROID)
44typedef pthread_t ThreadObject;
45typedef pthread_mutex_t MutexObject;
46typedef void* ThreadFuncRet;
47#elif PLATFORM_DOLPHIN
48typedef lwp_t ThreadObject;
49typedef mutex_t MutexObject;
50typedef void* ThreadFuncRet;
51#elif PLATFORM_3DS
52typedef Thread ThreadObject;
53typedef uint32_t MutexObject;
54typedef void ThreadFuncRet;
55#endif
56
57typedef ThreadFuncRet(*ThreadFuncFP)(void*);
58
59#if PLATFORM_3DS
60#define THREAD_RETURN() return;
61#else
62#define THREAD_RETURN() return 0;
63#endif
64
65enum class ScreenOrientation : uint8_t
66{
69 Auto,
70
71 Count
72};
73
75{
77 char mFilename[MAX_PATH_SIZE + 1] = { };
78 bool mDirectory = false;
79 bool mValid = false;
80
81#if PLATFORM_WINDOWS
82 WIN32_FIND_DATA mFindData = { };
83 HANDLE mFindHandle = nullptr;
84#elif (PLATFORM_LINUX || PLATFORM_ANDROID)
85 DIR* mDir = nullptr;
86#elif PLATFORM_DOLPHIN
87 DIR* mDir = nullptr;
88#elif PLATFORM_3DS
89 DIR* mDir = nullptr;
90#endif
91};
92
94{
95#if PLATFORM_WINDOWS
96 HINSTANCE mConnection = nullptr;
97 HWND mWindow = nullptr;
98 POINT mMinSize = {};
99 bool mWindowHasFocus = true;
100 bool mFullscreen = false;
101#elif PLATFORM_LINUX
102 xcb_connection_t* mXcbConnection = nullptr;
103 xcb_screen_t* mXcbScreen = nullptr;
104 xcb_window_t mXcbWindow = 0;
105 xcb_intern_atom_reply_t* mAtomDeleteWindow = nullptr;
106 xcb_cursor_t mNullCursor = XCB_NONE;
107 bool mWindowHasFocus = false;
108 bool mFullscreen = false;
109#elif PLATFORM_ANDROID
110 android_app* mState = nullptr;
111 ANativeWindow* mWindow = nullptr;
112 ANativeActivity* mActivity = nullptr;
113 //EGLDisplay mDisplay = ??? is this a pointer?;
114 //EGLSurface mSurface = ???;
115 //EGLContext mContext = ???;
116 std::string mInternalDataPath;
117 int32_t mWidth= 100;
118 int32_t mHeight = 100;
119 bool mWindowInitialized = false;
120 bool mWindowHasFocus = false;
121 bool mOrientationChanged = false;
124#elif PLATFORM_DOLPHIN
125 void* mFrameBuffers[2] = { };
126 void* mConsoleBuffer = nullptr;
127 GXRModeObj mGxRmode = { };
128 uint32_t mFrameIndex = 0;
129 void* mMemoryCardMountArea = nullptr;
130 bool mMemoryCardMounted = false;
131#elif PLATFORM_3DS
132 PrintConsole mPrintConsole = {};
133 float mSlider = 0.0f;
134 bool mNew3DS = false;
135#endif
136};
137
138enum class LogSeverity : uint32_t
139{
140 Debug,
141 Warning,
142 Error,
143
144 Count
145};
146
148{
149 std::string mName;
150 uint64_t mBytesFree = 0;
151 uint64_t mBytesAllocated = 0;
152};
#define MAX_PATH_SIZE
Definition Constants.h:8
ThreadFuncRet(* ThreadFuncFP)(void *)
Definition SystemTypes.h:57
LogSeverity
Definition SystemTypes.h:139
ScreenOrientation
Definition SystemTypes.h:66
Definition SystemTypes.h:75
bool mDirectory
Definition SystemTypes.h:78
bool mValid
Definition SystemTypes.h:79
char mFilename[MAX_PATH_SIZE+1]
Definition SystemTypes.h:77
char mDirectoryPath[MAX_PATH_SIZE+1]
Definition SystemTypes.h:76
Definition SystemTypes.h:148
uint64_t mBytesFree
Definition SystemTypes.h:150
std::string mName
Definition SystemTypes.h:149
uint64_t mBytesAllocated
Definition SystemTypes.h:151
Definition SystemTypes.h:94