Atlas - SDL_x11opengl.h
Home / ext / SDL / src / video / x11 Lines: 1 | Size: 3951 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21#include "SDL_internal.h" 22 23#ifndef SDL_x11opengl_h_ 24#define SDL_x11opengl_h_ 25 26#ifdef SDL_VIDEO_OPENGL_GLX 27#include <SDL3/SDL_opengl.h> 28#include <GL/glx.h> 29 30typedef void (*__GLXextFuncPtr)(void); 31 32typedef enum SDL_GLSwapIntervalTearBehavior 33{ 34 SDL_SWAPINTERVALTEAR_UNTESTED, 35 SDL_SWAPINTERVALTEAR_UNKNOWN, 36 SDL_SWAPINTERVALTEAR_MESA, 37 SDL_SWAPINTERVALTEAR_NVIDIA 38} SDL_GLSwapIntervalTearBehavior; 39 40struct SDL_GLDriverData 41{ 42 int errorBase, eventBase; 43 44 bool HAS_GLX_EXT_visual_rating; 45 bool HAS_GLX_EXT_visual_info; 46 bool HAS_GLX_EXT_swap_control_tear; 47 bool HAS_GLX_ARB_context_flush_control; 48 bool HAS_GLX_ARB_create_context_robustness; 49 bool HAS_GLX_ARB_create_context_no_error; 50 bool HAS_GLX_ARB_framebuffer_sRGB; 51 52 /* Max version of OpenGL ES context that can be created if the 53 implementation supports GLX_EXT_create_context_es2_profile. 54 major = minor = 0 when unsupported. 55 */ 56 struct 57 { 58 int major; 59 int minor; 60 } es_profile_max_supported_version; 61 62 SDL_GLSwapIntervalTearBehavior swap_interval_tear_behavior; 63 64 Bool (*glXQueryExtension)(Display *, int *, int *); 65 __GLXextFuncPtr (*glXGetProcAddress)(const GLubyte *); 66 XVisualInfo *(*glXChooseVisual)(Display *, int, int *); 67 GLXContext (*glXCreateContext)(Display *, XVisualInfo *, GLXContext, Bool); 68 GLXContext (*glXCreateContextAttribsARB)(Display *, GLXFBConfig, GLXContext, Bool, const int *); 69 GLXFBConfig *(*glXChooseFBConfig)(Display *, int, const int *, int *); 70 XVisualInfo *(*glXGetVisualFromFBConfig)(Display *, GLXFBConfig); 71 void (*glXDestroyContext)(Display *, GLXContext); 72 Bool (*glXMakeCurrent)(Display *, GLXDrawable, GLXContext); 73 void (*glXSwapBuffers)(Display *, GLXDrawable); 74 void (*glXQueryDrawable)(Display *, GLXDrawable, int, unsigned int *); 75 void (*glXSwapIntervalEXT)(Display *, GLXDrawable, int); 76 int (*glXSwapIntervalSGI)(int); 77 int (*glXSwapIntervalMESA)(int); 78 int (*glXGetSwapIntervalMESA)(void); 79}; 80 81// OpenGL functions 82extern bool X11_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); 83extern SDL_FunctionPointer X11_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); 84extern void X11_GL_UnloadLibrary(SDL_VideoDevice *_this); 85extern bool X11_GL_UseEGL(SDL_VideoDevice *_this); 86extern XVisualInfo *X11_GL_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, bool transparent); 87extern SDL_GLContext X11_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); 88extern bool X11_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, 89 SDL_GLContext context); 90extern bool X11_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval); 91extern bool X11_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); 92extern bool X11_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); 93extern bool X11_GL_DestroyContext(SDL_VideoDevice *_this, SDL_GLContext context); 94 95#endif // SDL_VIDEO_OPENGL_GLX 96 97#endif // SDL_x11opengl_h_ 98[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.