|
@@ -45,6 +45,9 @@
|
|
|
#include <X11/cursorfont.h>
|
|
|
#include <GL/glx.h>
|
|
|
#endif
|
|
|
+#ifdef __APPLE__
|
|
|
+#include <execinfo.h>
|
|
|
+#endif
|
|
|
#ifdef _WIN32
|
|
|
#include <GL/wglew.h>
|
|
|
#include <GL/wgl.h>
|
|
@@ -436,7 +439,7 @@ void la_DestroySystemWindowWin32(laWindow* w) {
|
|
|
};
|
|
|
#endif
|
|
|
|
|
|
-#ifdef __linux__
|
|
|
+#if defined(__linux__) || defined(__APPLE__)
|
|
|
void la_HandlerSIGSEGV(int sig) {
|
|
|
void *array[30];
|
|
|
size_t sz;
|
|
@@ -527,6 +530,9 @@ int la_CreateSystemWindow(laWindow *window, int SyncToVBlank){
|
|
|
#endif
|
|
|
#ifdef _WIN32
|
|
|
SYSWINDOW hwnd = la_CreateWindowWin32(window->X, window->Y, window->W, window->H, window->Title->Ptr, SyncToVBlank, &glc);
|
|
|
+#endif
|
|
|
+#ifdef __APPLE__
|
|
|
+ SYSWINDOW hwnd = glfwCreateWindow(window->W, window->H, window->Title->Ptr, NULL, NULL);
|
|
|
#endif
|
|
|
window->win = hwnd;
|
|
|
window->glc = glc;
|
|
@@ -884,7 +890,7 @@ void laProcessInitArguments(int argc, char* argv[],laInitArguments* ia) {
|
|
|
}
|
|
|
}
|
|
|
int laGetReadyWith(laInitArguments* ia){
|
|
|
-#ifdef __linux__
|
|
|
+#if defined(__linux__) || defined(__APPLE__)
|
|
|
signal(SIGSEGV,la_HandlerSIGSEGV);
|
|
|
#endif
|
|
|
|
|
@@ -1134,6 +1140,9 @@ int laGetReadyWith(laInitArguments* ia){
|
|
|
#endif
|
|
|
#ifdef __linux__
|
|
|
int dpi = la_GetDPI(DefaultRootWindow(MAIN.dpy));
|
|
|
+#endif
|
|
|
+#ifdef __APPLE__
|
|
|
+ int dpi = 72;
|
|
|
#endif
|
|
|
if((!dpi) || dpi<144){ dpi=144; } if(dpi>300){ dpi=300; }
|
|
|
int UiSize=(int)(tnsLinearItp(16.0f,24.0f,tnsGetRatiod(96,144,dpi))+0.5);
|
|
@@ -1519,7 +1528,9 @@ int la_OnWindowDestroy(SYSWINDOW wnd){
|
|
|
void la_MakeSpecialKeyBit(SYSWINDOW hwnd,laWindow*wnd,laEvent *e,int use_last_pos){
|
|
|
laListHandle *el = &wnd->EventList;
|
|
|
laEvent* last_e=el->pLast;
|
|
|
+#ifndef __APPLE__ // TODO
|
|
|
SYSWINDOW root_ret, win_ret; int rrx=0,rry=0,rx=e->x,ry=e->y,rmask=0;
|
|
|
+#endif
|
|
|
#ifdef __linux__
|
|
|
XQueryPointer(MAIN.dpy, wnd->win, &root_ret,&win_ret,&rrx,&rry,&rx,&ry,&rmask);
|
|
|
e->SpecialKeyBit = ((rmask&ShiftMask)?LA_KEY_SHIFT:0)|((rmask&ControlMask)?LA_KEY_CTRL:0)|((rmask&Mod1Mask)?LA_KEY_ALT:0);
|