From 360d4419d8c293fcc9c8fa97c0852cc416e86d52 Mon Sep 17 00:00:00 2001 From: Colleague Riley Date: Mon, 21 Aug 2023 23:25:49 -0400 Subject: [PATCH] bug fix or something --- RGFW.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/RGFW.h b/RGFW.h index 58cc10d3..b5d369d3 100644 --- a/RGFW.h +++ b/RGFW.h @@ -1044,13 +1044,15 @@ RGFW_window* RGFW_createWindow(const char* name, int x, int y, int w, int h, uns XMatchVisualInfo((Display *)win->display, DefaultScreen((Display *)win->display), 32, TrueColor, vi); /* for RGBA backgrounds*/ - int context_attribs[5] = {0}; + int context_attribs[7] = {0, 0, 0, 0, 0, 0, 0}; + context_attribs[0] = GLX_CONTEXT_PROFILE_MASK_ARB; + context_attribs[1] = GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; if (RGFW_majorVersion || RGFW_minorVersion) { - context_attribs[0] = GLX_CONTEXT_MAJOR_VERSION_ARB; - context_attribs[1] = RGFW_majorVersion; - context_attribs[2] = GLX_CONTEXT_MINOR_VERSION_ARB; - context_attribs[3] = RGFW_minorVersion; + context_attribs[2] = GLX_CONTEXT_MAJOR_VERSION_ARB; + context_attribs[3] = RGFW_majorVersion; + context_attribs[4] = GLX_CONTEXT_MINOR_VERSION_ARB; + context_attribs[5] = RGFW_minorVersion; } glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0; @@ -2396,7 +2398,7 @@ RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { } break; - case WM_SIZE: + case WM_SIZE: { win->event.type = RGFW_windowAttribsChange; #ifndef RGFW_RECT @@ -2404,9 +2406,10 @@ RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { win->h = HIWORD(msg.lParam); #else win->r.w = LOWORD(msg.lParam); - win->r.h = HIWORD(msg.lParam) + win->r.h = HIWORD(msg.lParam); #endif break; + } case WM_MOVE: { win->event.type = RGFW_windowAttribsChange; @@ -2414,8 +2417,8 @@ RGFW_Event* RGFW_window_checkEvent(RGFW_window* win) { win->x = GET_X_LPARAM(msg.lParam); win->y = GET_Y_LPARAM(msg.lParam); #else - win->r.x = GET_X_LPARAM(lParam); - win->r.y = GET_Y_LPARAM(lParam); + win->r.x = GET_X_LPARAM(msg.lParam); + win->r.y = GET_Y_LPARAM(msg.lParam); #endif break; } @@ -3561,4 +3564,4 @@ void RGFW_window_checkFPS(RGFW_window* win) { #ifdef __cplusplus } -#endif +#endif \ No newline at end of file