mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-10 07:49:57 -04:00
Classic mac stuff
This commit is contained in:
parent
d28cef938e
commit
d639c66cf5
@ -216,9 +216,9 @@ typedef cc_uint8 cc_bool;
|
||||
#endif
|
||||
#define CC_BUILD_OPENAL
|
||||
#elif defined Macintosh
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL
|
||||
#define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_SOFTGPU
|
||||
#define CC_BUILD_MACCLASSIC
|
||||
#define CC_BUILD_CURL
|
||||
#define CC_BUILD_HTTPCLIENT
|
||||
#define CC_BUILD_OPENAL
|
||||
#elif defined __sun__
|
||||
#define CC_BUILD_SOLARIS
|
||||
|
@ -19,6 +19,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#undef true
|
||||
#undef false
|
||||
#include <MacMemory.h>
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; /* TODO: not used apparently */
|
||||
@ -184,7 +187,9 @@ cc_result File_Length(cc_file file, cc_uint32* len) {
|
||||
/*########################################################################################################################*
|
||||
*--------------------------------------------------------Threading--------------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
void Thread_Sleep(cc_uint32 milliseconds) { usleep(milliseconds * 1000); }
|
||||
void Thread_Sleep(cc_uint32 milliseconds) {
|
||||
// TODO Delay API
|
||||
}
|
||||
|
||||
void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char* name) {
|
||||
*handle = NULL;
|
||||
@ -296,18 +301,8 @@ cc_result Socket_CheckWritable(cc_socket s, cc_bool* writable) {
|
||||
cc_bool Process_OpenSupported = true;
|
||||
|
||||
static cc_result Process_RawStart(const char* path, char** argv) {
|
||||
pid_t pid = fork();
|
||||
if (pid == -1) return errno;
|
||||
|
||||
if (pid == 0) {
|
||||
/* Executed in child process */
|
||||
execvp(path, argv);
|
||||
_exit(127); /* "command not found" */
|
||||
} else {
|
||||
/* Executed in parent process */
|
||||
/* We do nothing here.. */
|
||||
return 0;
|
||||
}
|
||||
// TODO
|
||||
return ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static cc_result Process_RawGetExePath(char* path, int* len);
|
||||
|
176
src/Window_MacClassic.c
Normal file
176
src/Window_MacClassic.c
Normal file
@ -0,0 +1,176 @@
|
||||
#include "Core.h"
|
||||
#if defined CC_BUILD_MACCLASSIC
|
||||
|
||||
#include "_WindowBase.h"
|
||||
#include "String.h"
|
||||
#include "Funcs.h"
|
||||
#include "Bitmap.h"
|
||||
#include "Options.h"
|
||||
#include "Errors.h"
|
||||
|
||||
#undef true
|
||||
#undef false
|
||||
#include <Quickdraw.h>
|
||||
#include <Dialogs.h>
|
||||
#include <Fonts.h>
|
||||
static WindowPtr win;
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
*--------------------------------------------------Public implementation--------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
void Window_PreInit(void) { }
|
||||
void Window_Init(void) {
|
||||
InitGraf(&qd.thePort);
|
||||
InitFonts();
|
||||
InitWindows();
|
||||
InitMenus();
|
||||
}
|
||||
|
||||
void Window_Free(void) { }
|
||||
|
||||
static void DoCreateWindow(int width, int height) {
|
||||
Rect r = qd.screenBits.bounds;
|
||||
|
||||
// TODO
|
||||
SetRect(&r, r.left + 5, r.top + 45, r.right - 5, r.bottom - 5);
|
||||
win = NewWindow(NULL, &r, "\pClassiCube", true, 0, (WindowPtr)-1, false, 0);
|
||||
SetPort(win);
|
||||
}
|
||||
|
||||
void Window_Create2D(int width, int height) { DoCreateWindow(width, height); }
|
||||
void Window_Create3D(int width, int height) { DoCreateWindow(width, height); }
|
||||
|
||||
void Window_SetTitle(const cc_string* title) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Clipboard_GetText(cc_string* value) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Clipboard_SetText(const cc_string* value) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
int Window_GetWindowState(void) {
|
||||
return WINDOW_STATE_NORMAL;
|
||||
// TODO
|
||||
}
|
||||
|
||||
cc_result Window_EnterFullscreen(void) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
cc_result Window_ExitFullscreen(void) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Window_IsObscured(void) { return 0; }
|
||||
|
||||
void Window_Show(void) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Window_SetSize(int width, int height) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Window_RequestClose(void) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Window_ProcessEvents(float delta) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Window_ProcessGamepads(float delta) { }
|
||||
|
||||
static void Cursor_GetRawPos(int* x, int* y) {
|
||||
// TODO
|
||||
*x=0;*y=0;
|
||||
}
|
||||
|
||||
void Cursor_SetPosition(int x, int y) {
|
||||
// TODO
|
||||
}
|
||||
static void Cursor_DoSetVisible(cc_bool visible) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
static void ShowDialogCore(const char* title, const char* msg) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* args) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Window_AllocFramebuffer(struct Bitmap* bmp) {
|
||||
bmp->scan0 = (BitmapCol*)Mem_Alloc(bmp->width * bmp->height, 4, "window pixels");
|
||||
}
|
||||
|
||||
void Window_DrawFramebuffer(Rect2D r, struct Bitmap* bmp) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
||||
Mem_Free(bmp->scan0);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { }
|
||||
|
||||
void Window_EnableRawMouse(void) {
|
||||
DefaultEnableRawMouse();
|
||||
}
|
||||
|
||||
void Window_UpdateRawMouse(void) {
|
||||
DefaultUpdateRawMouse();
|
||||
}
|
||||
|
||||
void Window_DisableRawMouse(void) {
|
||||
DefaultDisableRawMouse();
|
||||
}
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
*-------------------------------------------------------WGL OpenGL--------------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
#if (CC_GFX_BACKEND == CC_GFX_BACKEND_GL) && !defined CC_BUILD_EGL
|
||||
void GLContext_Create(void) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void GLContext_Update(void) { }
|
||||
cc_bool GLContext_TryRestore(void) { return true; }
|
||||
void GLContext_Free(void) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void* GLContext_GetAddress(const char* function) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cc_bool GLContext_SwapBuffers(void) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
void GLContext_SetFpsLimit(cc_bool vsync, float minFrameMs) {
|
||||
// TODO
|
||||
}
|
||||
void GLContext_GetApiInfo(cc_string* info) { }
|
||||
#endif
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user