diff --git a/Makefile b/Makefile index 3117460b..f8991f5c 100644 --- a/Makefile +++ b/Makefile @@ -186,7 +186,7 @@ ifeq ($(RGFW_WAYLAND), 1) else ifeq ($(CC),emcc) @echo nostl is not supported on this platform else ifeq ($(detected_OS),Linux) - $(CC) $(CFLAGS) -I. $< -o $@$(EXT) + $(CC) $(CFLAGS) -I. -lXrandr $< -o $@$(EXT) else ifeq ($(detected_OS),windows) $(CC) $(CFLAGS) $(WARNINGS) -I. $< -lgdi32 -o $@$(EXT) else ifeq ($(detected_OS),Darwin) @@ -236,7 +236,7 @@ examples/gl33/gl33: examples/gl33/gl33.c RGFW.h ifeq ($(RGFW_WAYLAND), 1) $(CC) $(CFLAGS) -I. $< $(LIBS) $(LINK_GL1) -lwayland-egl -o $@$(EXT) else ifeq ($(detected_OS),Linux) - $(CC) $(CFLAGS) -I. $< -o $@$(EXT) + $(CC) $(CFLAGS) -I. $< -lXrandr -o $@$(EXT) else ifeq ($(detected_OS),windows) $(CC) $(CFLAGS) $(WARNINGS) -I. $< -lgdi32 -o $@$(EXT) else ifeq ($(detected_OS),Darwin) diff --git a/RGFW.h b/RGFW.h index ff0d3388..4d7a60fa 100644 --- a/RGFW.h +++ b/RGFW.h @@ -3336,7 +3336,7 @@ RGFW_window* RGFW_createWindowPtr(const char* name, RGFW_rect rect, RGFW_windowF RGFW_GOTO_WAYLAND(0); #ifdef RGFW_X11 u64 event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask | FocusChangeMask | LeaveWindowMask | EnterWindowMask | ExposureMask; /*!< X11 events accepted*/ - + #if defined(RGFW_OPENGL) && !defined(RGFW_EGL) u32* visual_attribs = (u32*)RGFW_initFormatAttribs(flags & RGFW_windowOpenglSoftware); i32 fbcount; @@ -3451,7 +3451,7 @@ RGFW_window* RGFW_createWindowPtr(const char* name, RGFW_rect rect, RGFW_windowF GLXContext ctx = NULL; - if (RGFW_root != NULL) + if (RGFW_root != NULL && RGFW_root != win) ctx = RGFW_root->src.ctx; win->src.ctx = glXCreateContextAttribsARB(win->src.display, bestFbc, ctx, True, context_attribs); diff --git a/examples/icons/icons.c b/examples/icons/icons.c index 5255ab0b..0d191190 100644 --- a/examples/icons/icons.c +++ b/examples/icons/icons.c @@ -8,11 +8,10 @@ int main(void) { int w, h, c; unsigned char* icon = stbi_load("logo.png", &w, &h, &c, 0); - - RGFW_mouse* mouse = RGFW_loadMouse(icon, RGFW_AREA(w, h), c); - +printf("hewwo\n"); RGFW_window* win = RGFW_createWindow("RGFW icons", RGFW_RECT(0, 0, 600, 400), RGFW_windowCenter | RGFW_windowNoResize); - +printf("hewwo\n"); + RGFW_mouse* mouse = RGFW_loadMouse(icon, RGFW_AREA(w, h), c); RGFW_window_setIcon(win, icon, RGFW_AREA(w, h), c); RGFW_window_setMouse(win, mouse); diff --git a/examples/osmesa/osmesa.c b/examples/osmesa/osmesa.c index 9e84f873..b15f8a51 100644 --- a/examples/osmesa/osmesa.c +++ b/examples/osmesa/osmesa.c @@ -30,9 +30,12 @@ void clear(RGFW_window* win, u8 color[4]) { int main(void) { RGFW_setClassName("RGFW Basic"); + RGFW_window* win = RGFW_createWindow("RGFW Example Window", RGFW_RECT(500, 500, 500, 500), RGFW_windowAllowDND | RGFW_windowCenter); + RGFW_window_initBuffer(win); + RGFW_window_makeCurrent(win); - screenSize = RGFW_getScreenSize(); + screenSize = RGFW_getScreenSize(); while (RGFW_window_shouldClose(win) == RGFW_FALSE) { while (RGFW_window_checkEvent(win) != NULL);