From 8f1dfecc9ab3a40e330d7a37f3fa806bd4aad2b0 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 30 Oct 2020 18:44:47 -0400 Subject: [PATCH] Tweaks --- mods/src/compat.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mods/src/compat.c b/mods/src/compat.c index f2e6a27..200e939 100644 --- a/mods/src/compat.c +++ b/mods/src/compat.c @@ -177,6 +177,10 @@ static void glfw_scroll(__attribute__((unused)) GLFWwindow *window, __attribute_ } } +// Default Window Size +#define DEFAULT_WIDTH 840 +#define DEFAULT_HEIGHT 480 + // Init GLFW HOOK(SDL_WM_SetCaption, void, (const char *title, __attribute__((unused)) const char *icon)) { FreeImage_Initialise(0); @@ -196,7 +200,7 @@ HOOK(SDL_WM_SetCaption, void, (const char *title, __attribute__((unused)) const glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - glfw_window = glfwCreateWindow(840, 480, title, NULL, NULL); + glfw_window = glfwCreateWindow(DEFAULT_WIDTH, DEFAULT_HEIGHT, title, NULL, NULL); if (!glfw_window) { fprintf(stderr, "Unable To Create GLFW Window\n"); exit(1); @@ -227,9 +231,9 @@ HOOK(eglSwapBuffers, EGLBoolean, (__attribute__((unused)) EGLDisplay display, __ static int is_fullscreen = 0; +// Old Size And Position To Use When Exiting Fullscreen static int old_width = -1; static int old_height = -1; - static int old_x = -1; static int old_y = -1; @@ -434,8 +438,8 @@ HOOK(XGetWindowAttributes, int, (Display *display, Window w, XWindowAttributes * XWindowAttributes attributes; attributes.x = 0; attributes.y = 0; - attributes.width = 640; - attributes.height = 480; + attributes.width = DEFAULT_WIDTH; + attributes.height = DEFAULT_HEIGHT; *window_attributes_return = attributes; return 1; } @@ -472,6 +476,6 @@ __attribute__((constructor)) static void init() { setenv("GALLIUM_DRIVER", "virpipe", 1); } is_server = mode == 2; - // Disable X11 When In Server Mode - setenv("SDL_VIDEODRIVER", is_server ? "dummy" : "x11", 1); + // Video is Handled By GLFW Not SDL + setenv("SDL_VIDEODRIVER", "dummy", 1); }