1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Load X11 dynamically

The loaders have been generated through hpvb's dynload-wrapper, although
they had to be heavily handpatched to workaround some already reported
issues with it. I added a note to each generated file to account for
that.

As GLAD uses X11 stuff directly, I had to define the GLAD_GLX_NO_X11
macro to not let do it that, and handle myself the display loading and
screen handling part myself, which wasn't that hard but it's still
something worth saying.

I plan to improve greatly the X11 backend (including this aspect) but,
as the release isn't that far and I'm also working on the Wayland
backend, this will do for now, I hope.
This commit is contained in:
Riteo
2022-11-29 12:03:06 +01:00
parent daf168f4c8
commit 2dd5a792bb
21 changed files with 12818 additions and 28 deletions

View File

@@ -321,8 +321,8 @@ void GLManager_X11::swap_buffers() {
glXSwapBuffers(_x_windisp.x11_display, _x_windisp.x11_window);
}
Error GLManager_X11::initialize() {
if (!gladLoaderLoadGLX(nullptr, 0)) {
Error GLManager_X11::initialize(Display *p_display) {
if (!gladLoaderLoadGLX(p_display, XScreenNumberOfScreen(XDefaultScreenOfDisplay(p_display)))) {
return ERR_CANT_CREATE;
}