mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 03:25:14 -04:00
Split into CC_BUILD_MACOS and CC_BUILD_IOS
This commit is contained in:
parent
aedd53eeb6
commit
2b17800a2c
@ -182,10 +182,16 @@ Thus it is **NOT SAFE** to allocate a string on the stack. */
|
||||
#define CC_BUILD_DARWIN
|
||||
#define CC_BUILD_POSIX
|
||||
#define CC_BUILD_GL
|
||||
#ifdef __x86_64__
|
||||
#if defined __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
|
||||
#define CC_BUILD_GLES
|
||||
#define CC_BUILD_GLMODERN
|
||||
#define CC_BUILD_IOS
|
||||
#elif defined __x86_64__
|
||||
#define CC_BUILD_COCOA
|
||||
#define CC_BUILD_MACOS
|
||||
#else
|
||||
#define CC_BUILD_CARBON
|
||||
#define CC_BUILD_MACOS
|
||||
#endif
|
||||
#define CC_BUILD_CURL
|
||||
#define CC_BUILD_OPENAL
|
||||
|
@ -1075,7 +1075,9 @@ void Gfx_OnWindowResize(void) { Gfx_LoseContext(" (resizing window)"); }
|
||||
#if defined CC_BUILD_WIN
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#elif defined CC_BUILD_DARWIN
|
||||
#elif defined CC_BUILD_IOS
|
||||
#include <OpenGLES/ES2/gl.h>
|
||||
#elif defined CC_BUILD_MACOS
|
||||
#include <OpenGL/gl.h>
|
||||
#elif defined CC_BUILD_GLES
|
||||
#include <GLES2/gl2.h>
|
||||
|
@ -65,7 +65,9 @@ const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
#if defined CC_BUILD_DARWIN
|
||||
#include <mach/mach_time.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#if defined CC_BUILD_MACOS
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#endif
|
||||
#elif defined CC_BUILD_SOLARIS
|
||||
#include <sys/filio.h>
|
||||
#elif defined CC_BUILD_BSD
|
||||
@ -1138,7 +1140,7 @@ cc_result Process_StartGame(const cc_string* args) {
|
||||
void Process_Exit(cc_result code) { exit(code); }
|
||||
|
||||
/* Opening browser/starting shell is not really standardised */
|
||||
#if defined CC_BUILD_DARWIN
|
||||
#if defined CC_BUILD_MACOS
|
||||
void Process_StartOpen(const cc_string* args) {
|
||||
UInt8 str[NATIVE_STR_LEN];
|
||||
CFURLRef urlCF;
|
||||
@ -1728,16 +1730,24 @@ static void Platform_InitStopwatch(void) {
|
||||
sw_freqDiv = (cc_uint64)tb.denom * 1000;
|
||||
}
|
||||
|
||||
void Platform_Init(void) {
|
||||
#if defined CC_BUILD_MACOS
|
||||
static void Platform_InitSpecific(void) {
|
||||
ProcessSerialNumber psn; /* TODO: kCurrentProcess */
|
||||
Platform_InitPosix();
|
||||
Platform_InitStopwatch();
|
||||
|
||||
/* NOTE: Call as soon as possible, otherwise can't click on dialog boxes. */
|
||||
GetCurrentProcess(&psn);
|
||||
/* NOTE: TransformProcessType is macOS 10.3 or later */
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
}
|
||||
#else
|
||||
/* Always foreground process on iOS */
|
||||
static void Platform_InitSpecific(void) { }
|
||||
#endif
|
||||
|
||||
void Platform_Init(void) {
|
||||
Platform_InitPosix();
|
||||
Platform_InitStopwatch();
|
||||
Platform_InitSpecific();
|
||||
}
|
||||
#elif defined CC_BUILD_WEB
|
||||
void Platform_Init(void) {
|
||||
char tmp[64+1] = { 0 };
|
||||
|
Loading…
x
Reference in New Issue
Block a user