/**************************************************************************/ /* gl_manager_x11.cpp */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /**************************************************************************/ /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #include "gl_manager_x11.h" #if defined(X11_ENABLED) && defined(GLES3_ENABLED) #include "thirdparty/glad/glad/glx.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define GLX_CONTEXT_MAJOR_VERSION_ARB … #define GLX_CONTEXT_MINOR_VERSION_ARB … GLXCREATECONTEXTATTRIBSARBPROC; // To prevent shadowing warnings #undef glXCreateContextAttribsARB struct GLManager_X11_Private { … }; GLManager_X11::GLDisplay::~GLDisplay() { … } static bool ctxErrorOccurred = …; static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) { … } int GLManager_X11::_find_or_create_display(Display *p_x11_display) { … } Error GLManager_X11::_create_context(GLDisplay &gl_display) { … } XVisualInfo GLManager_X11::get_vi(Display *p_display, Error &r_error) { … } Error GLManager_X11::open_display(Display *p_display) { … } Error GLManager_X11::window_create(DisplayServer::WindowID p_window_id, ::Window p_window, Display *p_display, int p_width, int p_height) { … } void GLManager_X11::_internal_set_current_window(GLWindow *p_win) { … } void GLManager_X11::window_resize(DisplayServer::WindowID p_window_id, int p_width, int p_height) { … } void GLManager_X11::window_destroy(DisplayServer::WindowID p_window_id) { … } void GLManager_X11::release_current() { … } void GLManager_X11::window_make_current(DisplayServer::WindowID p_window_id) { … } void GLManager_X11::swap_buffers() { … } Error GLManager_X11::initialize(Display *p_display) { … } void GLManager_X11::set_use_vsync(bool p_use) { … } bool GLManager_X11::is_using_vsync() const { … } void *GLManager_X11::get_glx_context(DisplayServer::WindowID p_window_id) { … } GLManager_X11::GLManager_X11(const Vector2i &p_size, ContextType p_context_type) { … } GLManager_X11::~GLManager_X11() { … } #endif // X11_ENABLED && GLES3_ENABLED