diff --git a/src/lindbergh/graphics.c b/src/lindbergh/graphics.c index 6cb8a0a..b729b2b 100644 --- a/src/lindbergh/graphics.c +++ b/src/lindbergh/graphics.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "config.h" #include "jvs.h" @@ -14,12 +15,23 @@ int gameModeWidth = -1; int gameModeHeight = -1; +void *glutMainLoopThread() +{ + glutMainLoop(); + return NULL; +} + FGAPI int FGAPIENTRY glutEnterGameMode() { char gameTitle[256] = {0}; strcat(gameTitle, getGameName()); strcat(gameTitle, " (GLUT)"); glutCreateWindow(gameTitle); + + // Outrun doesn't run the glutMainLoop through, so we'll do that here + pthread_t glutMainLoopID; + pthread_create(&glutMainLoopID, NULL, &glutMainLoopThread, NULL); + return 1; } @@ -83,7 +95,7 @@ Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int // attributes->override_redirect = False; Window window = _XCreateWindow(display, parent, x, y, width, height, border_width, depth, class, visual, valueMask, attributes); - printf("%d %d %d %d\n", x, y, width, height); + printf("XCreateWindow Resolution %d %d %d %d\n", x, y, width, height); if (getConfig()->fullscreen) { diff --git a/src/lindbergh/hook.c b/src/lindbergh/hook.c index 9d080bb..84ff46a 100644 --- a/src/lindbergh/hook.c +++ b/src/lindbergh/hook.c @@ -152,7 +152,7 @@ int open(const char *pathname, int flags) { int (*_open)(const char *pathname, int flags) = dlsym(RTLD_NEXT, "open"); - printf("Open %s\n", pathname); + //printf("Open %s\n", pathname); if (strcmp(pathname, "/dev/lbb") == 0) { @@ -190,7 +190,7 @@ int open(const char *pathname, int flags) FILE *fopen(const char *restrict pathname, const char *restrict mode) { FILE *(*_fopen)(const char *restrict pathname, const char *restrict mode) = dlsym(RTLD_NEXT, "fopen"); - printf("fopen %s\n", pathname); + //printf("fopen %s\n", pathname); if (strcmp(pathname, "/root/lindbergrc") == 0) { @@ -210,7 +210,7 @@ FILE *fopen(const char *restrict pathname, const char *restrict mode) FILE *fopen64(const char *pathname, const char *mode) { FILE *(*_fopen64)(const char *restrict pathname, const char *restrict mode) = dlsym(RTLD_NEXT, "fopen64"); - printf("fopen64 %s\n", pathname); + //printf("fopen64 %s\n", pathname); if (strcmp(pathname, "/proc/sys/kernel/osrelease") == 0) { @@ -227,7 +227,7 @@ FILE *fopen64(const char *pathname, const char *mode) int openat(int dirfd, const char *pathname, int flags) { int (*_openat)(int dirfd, const char *pathname, int flags) = dlsym(RTLD_NEXT, "openat"); - printf("openat %s\n", pathname); + //printf("openat %s\n", pathname); if (strcmp(pathname, "/dev/ttyS0") == 0 || strcmp(pathname, "/dev/ttyS1") == 0 || strcmp(pathname, "/dev/tts/0") == 0 || strcmp(pathname, "/dev/tts/1") == 0) {