mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-05 15:21:06 +00:00
pybullet: added EGL render device and window_backend option.
EGL review. EGL dynamic loading, windowType to int moved to glad2 Require GL 3.3 as GLInstancingRenderer.cpp uses glVertexAttribDivisor glad2 update with dynamic X11 added removed old file build fix fix mac/win EGL w/o c++11, off by default fix premake fixup: premake fix 2
This commit is contained in:
parent
4d00beefbb
commit
3d499c8a7a
@ -52,13 +52,13 @@
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/gl.c"}
|
||||
end
|
||||
if os.is("MacOSX") then
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/gl.c"}
|
||||
end
|
||||
|
||||
if os.is("Linux") then
|
||||
@ -70,7 +70,7 @@
|
||||
print("Using glad_glx")
|
||||
defines { "GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1"}
|
||||
files {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad/glad_glx.c"}
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad/glx.c"}
|
||||
end
|
||||
|
||||
print("Using glad and dynamic loading of GL functions")
|
||||
@ -78,7 +78,8 @@
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/gl.c",
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad/glx.c"}
|
||||
links {"dl"}
|
||||
|
||||
end
|
||||
|
@ -13,6 +13,7 @@ struct b3gWindowConstructionInfo
|
||||
void* m_windowHandle;
|
||||
const char* m_title;
|
||||
int m_openglVersion;
|
||||
int m_renderDevice;
|
||||
|
||||
|
||||
b3gWindowConstructionInfo(int width=1024, int height=768)
|
||||
@ -22,7 +23,8 @@ struct b3gWindowConstructionInfo
|
||||
m_colorBitsPerPixel(32),
|
||||
m_windowHandle(0),
|
||||
m_title("title"),
|
||||
m_openglVersion(3)
|
||||
m_openglVersion(3),
|
||||
m_renderDevice(-1)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
@ -118,6 +118,8 @@ static b3AlignedObjectArray<const char*> allNames;
|
||||
static float gFixedTimeStep = 0;
|
||||
bool gAllowRetina = true;
|
||||
bool gDisableDemoSelection = false;
|
||||
int gRenderDevice = -1;
|
||||
int gWindowBackend = 0;
|
||||
static class ExampleEntries* gAllExamples=0;
|
||||
bool sUseOpenGL2 = false;
|
||||
#ifndef USE_OPENGL3
|
||||
@ -922,6 +924,8 @@ bool OpenGLExampleBrowser::init(int argc, char* argv[])
|
||||
#ifndef NO_OPENGL3
|
||||
SimpleOpenGL3App* simpleApp=0;
|
||||
sUseOpenGL2 = args.CheckCmdLineFlag("opengl2");
|
||||
args.GetCmdLineArgument("render_device", gRenderDevice);
|
||||
args.GetCmdLineArgument("window_backend", gWindowBackend);
|
||||
#else
|
||||
sUseOpenGL2 = true;
|
||||
#endif
|
||||
@ -951,7 +955,7 @@ bool OpenGLExampleBrowser::init(int argc, char* argv[])
|
||||
{
|
||||
char title[1024];
|
||||
sprintf(title,"%s using OpenGL3+ %s %s", appTitle,glContext, optMode);
|
||||
simpleApp = new SimpleOpenGL3App(title,width,height, gAllowRetina);
|
||||
simpleApp = new SimpleOpenGL3App(title,width,height, gAllowRetina, gWindowBackend, gRenderDevice);
|
||||
s_app = simpleApp;
|
||||
}
|
||||
#endif
|
||||
|
@ -23,7 +23,7 @@ LIST(REMOVE_ITEM OpenGLWindowCommon_CPP MacOpenGLWindow.cpp )
|
||||
#MESSAGE (${OpenGLWindowCommon_CPP})
|
||||
|
||||
IF (WIN32)
|
||||
SET(OpenGLWindow_SRCS ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowWin32_CPP} ${OpenGLWindowCommon_CPP})
|
||||
SET(OpenGLWindow_SRCS ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/gl.c ${OpenGLWindowWin32_CPP} ${OpenGLWindowCommon_CPP})
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
)
|
||||
@ -31,7 +31,7 @@ IF (WIN32)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF (APPLE)
|
||||
SET(OpenGLWindow_SRCS ${OpenGLWindowMac_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowMacObjC_CPP} ${OpenGLWindowCommon_CPP} )
|
||||
SET(OpenGLWindow_SRCS ${OpenGLWindowMac_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/gl.c ${OpenGLWindowMacObjC_CPP} ${OpenGLWindowCommon_CPP} )
|
||||
ENDIF(APPLE)
|
||||
|
||||
#no Linux detection?
|
||||
@ -44,7 +44,7 @@ IF(NOT WIN32 AND NOT APPLE)
|
||||
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
||||
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
||||
ADD_DEFINITIONS("-DDYNAMIC_LOAD_X11_FUNCTIONS=1")
|
||||
SET(OpenGLWindow_SRCS ${OpenGLWindowLinux_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad_glx.c ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowCommon_CPP} )
|
||||
SET(OpenGLWindow_SRCS ${OpenGLWindowLinux_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glx.c ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/gl.c ${OpenGLWindowCommon_CPP} )
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
@ -36,11 +36,8 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "OpenGLInclude.h"
|
||||
|
||||
#include "third_party/GL/gl/include/EGL/egl.h"
|
||||
#include "third_party/GL/gl/include/EGL/eglext.h"
|
||||
#include "third_party/GL/gl/include/GL/gl.h"
|
||||
#include <glad/gl.h>
|
||||
#include <glad/egl.h>
|
||||
|
||||
#include "EGLOpenGLWindow.h"
|
||||
|
||||
@ -49,6 +46,7 @@ struct EGLInternalData2 {
|
||||
|
||||
int m_windowWidth;
|
||||
int m_windowHeight;
|
||||
int m_renderDevice;
|
||||
|
||||
b3KeyboardCallback m_keyboardCallback;
|
||||
b3WheelCallback m_wheelCallback;
|
||||
@ -82,6 +80,8 @@ void EGLOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci) {
|
||||
m_data->m_windowWidth = ci.m_width;
|
||||
m_data->m_windowHeight = ci.m_height;
|
||||
|
||||
m_data->m_renderDevice = ci.m_renderDevice;
|
||||
|
||||
EGLint egl_config_attribs[] = {EGL_RED_SIZE,
|
||||
8,
|
||||
EGL_GREEN_SIZE,
|
||||
@ -101,16 +101,14 @@ void EGLOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci) {
|
||||
EGL_NONE,
|
||||
};
|
||||
|
||||
// Initialize EGL display
|
||||
PFNEGLQUERYDEVICESEXTPROC eglQueryDevicesEXT =
|
||||
(PFNEGLQUERYDEVICESEXTPROC)eglGetProcAddress("eglQueryDevicesEXT");
|
||||
if (eglQueryDevicesEXT == nullptr) m_data->egl_display = EGL_NO_DISPLAY;
|
||||
|
||||
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT =
|
||||
(PFNEGLGETPLATFORMDISPLAYEXTPROC)eglGetProcAddress(
|
||||
"eglGetPlatformDisplayEXT");
|
||||
if (eglGetPlatformDisplayEXT == nullptr) m_data->egl_display = EGL_NO_DISPLAY;
|
||||
|
||||
// Load EGL functions
|
||||
int egl_version = gladLoadEGLInternalLoader(NULL);
|
||||
if(!egl_version) {
|
||||
fprintf(stderr, "failed to EGL with glad.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
};
|
||||
|
||||
// Query EGL Devices
|
||||
const int max_devices = 32;
|
||||
EGLDeviceEXT egl_devices[max_devices];
|
||||
EGLint num_devices = 0;
|
||||
@ -120,10 +118,31 @@ void EGLOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci) {
|
||||
printf("eglQueryDevicesEXT Failed.\n");
|
||||
m_data->egl_display = EGL_NO_DISPLAY;
|
||||
}
|
||||
|
||||
for (EGLint i = 0; i < num_devices; ++i) {
|
||||
// Query EGL Screens
|
||||
if(m_data->m_renderDevice == -1) {
|
||||
// Chose default screen, by trying all
|
||||
for (EGLint i = 0; i < num_devices; ++i) {
|
||||
// Set display
|
||||
EGLDisplay display = eglGetPlatformDisplayEXT(EGL_PLATFORM_DEVICE_EXT,
|
||||
egl_devices[i], NULL);
|
||||
if (eglGetError() == EGL_SUCCESS && display != EGL_NO_DISPLAY) {
|
||||
int major, minor;
|
||||
EGLBoolean initialized = eglInitialize(display, &major, &minor);
|
||||
if (eglGetError() == EGL_SUCCESS && initialized == EGL_TRUE) {
|
||||
m_data->egl_display = display;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Chose specific screen, by using m_renderDevice
|
||||
if (m_data->m_renderDevice < 0 || m_data->m_renderDevice >= num_devices) {
|
||||
fprintf(stderr, "Invalid render_device choice: %d < %d.\n", m_data->m_renderDevice, num_devices);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Set display
|
||||
EGLDisplay display = eglGetPlatformDisplayEXT(EGL_PLATFORM_DEVICE_EXT,
|
||||
egl_devices[i], nullptr);
|
||||
egl_devices[m_data->m_renderDevice], NULL);
|
||||
if (eglGetError() == EGL_SUCCESS && display != EGL_NO_DISPLAY) {
|
||||
int major, minor;
|
||||
EGLBoolean initialized = eglInitialize(display, &major, &minor);
|
||||
@ -132,7 +151,21 @@ void EGLOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!eglInitialize(m_data->egl_display, NULL, NULL)) {
|
||||
fprintf(stderr, "Unable to initialize EGL\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
egl_version = gladLoadEGLInternalLoader(m_data->egl_display);
|
||||
if (!egl_version) {
|
||||
fprintf(stderr, "Unable to reload EGL.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
printf("Loaded EGL %d.%d after reload.\n", egl_version / 10,
|
||||
egl_version % 10);
|
||||
|
||||
|
||||
m_data->success = eglBindAPI(EGL_OPENGL_API);
|
||||
if (!m_data->success) {
|
||||
// TODO: Properly handle this error (requires change to default window
|
||||
@ -140,27 +173,44 @@ void EGLOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci) {
|
||||
fprintf(stderr, "Failed to bind OpenGL API.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
m_data->success =
|
||||
eglChooseConfig(m_data->egl_display, egl_config_attribs,
|
||||
&m_data->egl_config, 1, &m_data->num_configs);
|
||||
if (!m_data->success) {
|
||||
// TODO: Properly handle this error (requires change to default window
|
||||
// API to change return on all window types to bool).
|
||||
fprintf(stderr, "Failed to bind OpenGL API.\n");
|
||||
fprintf(stderr, "Failed to choose config (eglError: %d)\n", eglGetError());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (m_data->num_configs != 1) {
|
||||
fprintf(stderr, "Didn't get exactly one config, but %d\n", m_data->num_configs);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
m_data->egl_surface = eglCreatePbufferSurface(
|
||||
m_data->egl_display, m_data->egl_config, egl_pbuffer_attribs);
|
||||
|
||||
if (m_data->egl_surface == EGL_NO_SURFACE) {
|
||||
fprintf(stderr, "Unable to create EGL surface (eglError: %d)\n", eglGetError());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
m_data->egl_context = eglCreateContext(
|
||||
m_data->egl_display, m_data->egl_config, EGL_NO_CONTEXT, nullptr);
|
||||
m_data->egl_display, m_data->egl_config, EGL_NO_CONTEXT, NULL);
|
||||
if (!m_data->egl_context) {
|
||||
fprintf(stderr, "Unable to create EGL context (eglError: %d)\n",eglGetError());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
eglMakeCurrent(m_data->egl_display, m_data->egl_surface, m_data->egl_surface,
|
||||
m_data->egl_context);
|
||||
printf("Finish creating EGL OpenGL window.\n");
|
||||
|
||||
if (!gladLoadGLInternalLoader()) {
|
||||
fprintf(stderr, "failed to GL with glad.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
const GLubyte* ven = glGetString(GL_VENDOR);
|
||||
printf("GL_VENDOR=%s\n", ven);
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#ifdef BT_USE_EGL
|
||||
|
||||
#define b3gDefaultOpenGLWindow EGLOpenGLWindow
|
||||
|
||||
#include "../CommonInterfaces/CommonWindowInterface.h"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#ifdef B3_USE_GLFW
|
||||
#include "GLFWOpenGLWindow.h"
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <glad/gl.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -483,8 +483,8 @@ int Mac_createWindow(struct MacOpenGLWindowInternalData* m_internalData,struct M
|
||||
[m_internalData->m_myApp finishLaunching];
|
||||
[pool release];
|
||||
|
||||
if(!gladLoadGL()) {
|
||||
printf("gladLoadGL failed!\n");
|
||||
if(!gladLoadGLInternalLoader()) {
|
||||
printf("gladLoadGLInternalLoader failed!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
@ -24,10 +24,10 @@ subject to the following restrictions:
|
||||
#else
|
||||
|
||||
#ifdef B3_USE_GLFW
|
||||
#include "glad/glad.h"
|
||||
#include "glad/gl.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
#else
|
||||
#include "glad/glad.h"
|
||||
#include "glad/gl.h"
|
||||
#endif //B3_USE_GLFW
|
||||
#endif //BT_NO_GLAD
|
||||
|
||||
|
@ -23,10 +23,10 @@ subject to the following restrictions:
|
||||
#include "third_party/GL/gl/include/GL/gl.h"
|
||||
#else
|
||||
#ifdef B3_USE_GLFW
|
||||
#include <glad/glad.h>
|
||||
#include <glad/gl.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#else
|
||||
#include "glad/glad.h"
|
||||
#include "glad/gl.h"
|
||||
#endif //B3_USE_GLFW
|
||||
#endif //BT_NO_GLAD
|
||||
#endif //__OPENGL_INCLUDE_H
|
||||
|
@ -28,10 +28,10 @@
|
||||
#include "Win32OpenGLWindow.h"
|
||||
#else
|
||||
//let's cross the fingers it is Linux/X11
|
||||
#include "X11OpenGLWindow.h"
|
||||
#ifdef BT_USE_EGL
|
||||
#include "EGLOpenGLWindow.h"
|
||||
#else
|
||||
#include "X11OpenGLWindow.h"
|
||||
#endif //BT_USE_EGL
|
||||
#endif //_WIN32
|
||||
#endif//__APPLE__
|
||||
|
@ -17,10 +17,11 @@
|
||||
#include "Win32OpenGLWindow.h"
|
||||
#else
|
||||
//let's cross the fingers it is Linux/X11
|
||||
#include "X11OpenGLWindow.h"
|
||||
#define BT_USE_X11 // for runtime backend selection, move to build?
|
||||
#ifdef BT_USE_EGL
|
||||
#include "EGLOpenGLWindow.h"
|
||||
#else
|
||||
#include "X11OpenGLWindow.h"
|
||||
#endif //BT_USE_EGL
|
||||
#endif //_WIN32
|
||||
#endif//__APPLE__
|
||||
@ -295,7 +296,7 @@ static void printGLString(const char *name, GLenum s) {
|
||||
bool sOpenGLVerbose = true;
|
||||
|
||||
|
||||
SimpleOpenGL3App::SimpleOpenGL3App(const char* title, int width, int height, bool allowRetina, int maxNumObjectCapacity, int maxShapeCapacityInBytes)
|
||||
SimpleOpenGL3App::SimpleOpenGL3App(const char* title, int width, int height, bool allowRetina, int maxNumObjectCapacity, int maxShapeCapacityInBytes, int windowType, int renderDevice)
|
||||
{
|
||||
gApp = this;
|
||||
|
||||
@ -306,7 +307,28 @@ SimpleOpenGL3App::SimpleOpenGL3App(const char* title, int width, int height, boo
|
||||
m_data->m_userPointer = 0;
|
||||
m_data->m_upAxis = 1;
|
||||
|
||||
m_window = new b3gDefaultOpenGLWindow();
|
||||
if( windowType == 0) {
|
||||
m_window = new b3gDefaultOpenGLWindow();
|
||||
} else if (windowType == 1) {
|
||||
#ifdef BT_USE_X11
|
||||
m_window = new X11OpenGLWindow();
|
||||
#else
|
||||
b3Warning("X11 requires Linux. Loading default window instead. \n");
|
||||
m_window = new b3gDefaultOpenGLWindow();
|
||||
#endif
|
||||
} else if ( windowType == 2 ) {
|
||||
#ifdef BT_USE_EGL
|
||||
m_window = new EGLOpenGLWindow();
|
||||
#else
|
||||
b3Warning("EGL window requires compilation with BT_USE_EGL.\n");
|
||||
b3Warning("Loading default window instead. \n");
|
||||
m_window = new b3gDefaultOpenGLWindow();
|
||||
#endif
|
||||
} else {
|
||||
b3Warning("Unknown window type %d must be (0=default, 1=X11, 2=EGL).\n", windowType);
|
||||
b3Warning("Loading default window instead. \n");
|
||||
m_window = new b3gDefaultOpenGLWindow();
|
||||
}
|
||||
|
||||
m_window->setAllowRetina(allowRetina);
|
||||
|
||||
@ -314,6 +336,7 @@ SimpleOpenGL3App::SimpleOpenGL3App(const char* title, int width, int height, boo
|
||||
ci.m_title = title;
|
||||
ci.m_width = width;
|
||||
ci.m_height = height;
|
||||
ci.m_renderDevice = renderDevice;
|
||||
m_window->createWindow(ci);
|
||||
|
||||
m_window->setWindowTitle(title);
|
||||
|
@ -16,7 +16,7 @@ struct SimpleOpenGL3App : public CommonGraphicsApp
|
||||
class GLInstancingRenderer* m_instancingRenderer;
|
||||
virtual void setBackgroundColor(float red, float green, float blue);
|
||||
|
||||
SimpleOpenGL3App(const char* title, int width,int height, bool allowRetina=true, int maxNumObjectCapacity = 128 * 1024, int maxShapeCapacityInBytes = 128 * 1024 * 1024);
|
||||
SimpleOpenGL3App(const char* title, int width,int height, bool allowRetina=true, int maxNumObjectCapacity = 128 * 1024, int maxShapeCapacityInBytes = 128 * 1024 * 1024, int windowType=0, int renderDevice=-1);
|
||||
|
||||
virtual ~SimpleOpenGL3App();
|
||||
|
||||
|
@ -84,8 +84,8 @@ void Win32OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
|
||||
//VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem, this);
|
||||
enableOpenGL();
|
||||
|
||||
if(!gladLoadGL()) {
|
||||
printf("gladLoadGL failed!\n");
|
||||
if(!gladLoadGLInternalLoader()) {
|
||||
printf("gladLoadGLInternalLoader failed!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@ -195,4 +195,4 @@ int Win32OpenGLWindow::getHeight() const
|
||||
|
||||
#endif
|
||||
|
||||
#endif //B3_USE_GLFW
|
||||
#endif //B3_USE_GLFW
|
||||
|
@ -6,9 +6,14 @@
|
||||
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#ifdef GLEW_STATIC
|
||||
#include "glad/gl.h"
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#endif//GLEW_STATIC
|
||||
|
||||
#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||
#include "glad/glad_glx.h"
|
||||
#include "glad/glx.h"
|
||||
#else
|
||||
#include <GL/glx.h>
|
||||
#endif // GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||
@ -369,7 +374,7 @@ void X11OpenGLWindow::enableOpenGL()
|
||||
|
||||
GLXContext ctx = 0;
|
||||
|
||||
// Install an X error handler so the application won't exit if GL 3.0
|
||||
// Install an X error handler so the application won't exit if GL 3.3
|
||||
// context allocation fails.
|
||||
//
|
||||
// Note this error handler is global. All display connections in all threads
|
||||
@ -389,12 +394,12 @@ void X11OpenGLWindow::enableOpenGL()
|
||||
ctx = glXCreateNewContext( m_data->m_dpy, m_data->m_bestFbc, GLX_RGBA_TYPE, 0, True );
|
||||
}
|
||||
|
||||
// If it does, try to get a GL 3.0 context!
|
||||
// If it does, try to get a GL 3.3 context!
|
||||
else
|
||||
{
|
||||
int context_attribs[] = {
|
||||
GLX_CONTEXT_MAJOR_VERSION_ARB ,3,
|
||||
GLX_CONTEXT_MINOR_VERSION_ARB, 2,
|
||||
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
|
||||
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
|
||||
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,None
|
||||
};
|
||||
@ -415,10 +420,10 @@ void X11OpenGLWindow::enableOpenGL()
|
||||
// Sync to ensure any errors generated are processed.
|
||||
MyXSync( m_data->m_dpy, False );
|
||||
if ( !ctxErrorOccurred && ctx )
|
||||
printf( "Created GL 3.0 context\n" );
|
||||
printf( "Created GL 3.3 context\n" );
|
||||
else
|
||||
{
|
||||
// Couldn't create GL 3.0 context. Fall back to old-style 2.x context.
|
||||
// Couldn't create GL 3.3 context. Fall back to old-style 2.x context.
|
||||
// When a context version below 3.0 is requested, implementations will
|
||||
// return the newest context version compatible with OpenGL versions less
|
||||
// than version 3.0.
|
||||
@ -429,7 +434,7 @@ void X11OpenGLWindow::enableOpenGL()
|
||||
|
||||
ctxErrorOccurred = false;
|
||||
|
||||
printf( "Failed to create GL 3.0 context"
|
||||
printf( "Failed to create GL 3.3 context"
|
||||
" ... using old-style GLX context\n" );
|
||||
ctx = glXCreateContextAttribsARB( m_data->m_dpy, m_data->m_bestFbc, 0,
|
||||
True, context_attribs );
|
||||
@ -468,7 +473,7 @@ void X11OpenGLWindow::enableOpenGL()
|
||||
glXMakeCurrent(m_data->m_dpy, m_data->m_win, m_data->m_glc);
|
||||
}
|
||||
|
||||
if(!gladLoadGL()) {
|
||||
if(!gladLoadGLInternalLoader()) {
|
||||
printf("gladLoadGL failed!\n");
|
||||
exit(-1);
|
||||
}
|
||||
@ -519,12 +524,13 @@ void X11OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
|
||||
|
||||
#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||
|
||||
int res=gladLoadGLX(m_data->m_dpy,DefaultScreen(m_data->m_dpy));
|
||||
if (!res)
|
||||
{
|
||||
printf("Error in gladLoadGLX\n");
|
||||
exit(0);
|
||||
}
|
||||
int res=gladLoadGLXInternalLoader(m_data->m_dpy,DefaultScreen(m_data->m_dpy));
|
||||
if (!res)
|
||||
{
|
||||
printf("Error in gladLoadGLX\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include <math.h>
|
||||
#ifdef B3_USE_GLFW
|
||||
#include "glad/glad.h"
|
||||
#include "glad/gl.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
#else
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#ifdef GLEW_STATIC
|
||||
#include "glad/glad.h"
|
||||
#include "glad/gl.h"
|
||||
#else
|
||||
#ifdef NO_GLEW
|
||||
#define GL_GLEXT_LEGACY
|
||||
|
160
examples/ThirdPartyLibs/glad/EGL/eglplatform.h
Normal file
160
examples/ThirdPartyLibs/glad/EGL/eglplatform.h
Normal file
@ -0,0 +1,160 @@
|
||||
#ifndef __eglplatform_h_
|
||||
#define __eglplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2016 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are 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 Materials.
|
||||
**
|
||||
** THE MATERIALS ARE 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
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for egl.h
|
||||
* $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
||||
* by filing a bug against product "EGL" component "Registry".
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
/* Macros used in EGL function prototype declarations.
|
||||
*
|
||||
* EGL functions should be prototyped as:
|
||||
*
|
||||
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
|
||||
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
|
||||
*
|
||||
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
|
||||
*/
|
||||
|
||||
#ifndef EGLAPI
|
||||
#define EGLAPI KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef EGLAPIENTRY
|
||||
#define EGLAPIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
#define EGLAPIENTRYP EGLAPIENTRY*
|
||||
|
||||
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
|
||||
* are aliases of window-system-dependent types, such as X Display * or
|
||||
* Windows Device Context. They must be defined in platform-specific
|
||||
* code below. The EGL-prefixed versions of Native*Type are the same
|
||||
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
|
||||
*
|
||||
* Khronos STRONGLY RECOMMENDS that you use the default definitions
|
||||
* provided below, since these changes affect both binary and source
|
||||
* portability of applications using EGL running on different EGL
|
||||
* implementations.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
typedef HDC EGLNativeDisplayType;
|
||||
typedef HBITMAP EGLNativePixmapType;
|
||||
typedef HWND EGLNativeWindowType;
|
||||
|
||||
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
|
||||
#elif defined(WL_EGL_PLATFORM)
|
||||
|
||||
typedef struct wl_display *EGLNativeDisplayType;
|
||||
typedef struct wl_egl_pixmap *EGLNativePixmapType;
|
||||
typedef struct wl_egl_window *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__GBM__)
|
||||
|
||||
typedef struct gbm_device *EGLNativeDisplayType;
|
||||
typedef struct gbm_bo *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__ANDROID__) || defined(ANDROID)
|
||||
|
||||
struct ANativeWindow;
|
||||
struct egl_native_pixmap_t;
|
||||
|
||||
typedef struct ANativeWindow* EGLNativeWindowType;
|
||||
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
|
||||
typedef void* EGLNativeDisplayType;
|
||||
|
||||
#elif defined(__unix__) || defined(__APPLE__)
|
||||
|
||||
#if defined(MESA_EGL_NO_X11_HEADERS)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#else
|
||||
|
||||
/* X11 (tentative) */
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
typedef Display *EGLNativeDisplayType;
|
||||
typedef Pixmap EGLNativePixmapType;
|
||||
typedef Window EGLNativeWindowType;
|
||||
|
||||
#endif /* MESA_EGL_NO_X11_HEADERS */
|
||||
|
||||
#elif __HAIKU__
|
||||
#include <kernel/image.h>
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#else
|
||||
#error "Platform not recognized"
|
||||
#endif
|
||||
|
||||
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
|
||||
typedef EGLNativeDisplayType NativeDisplayType;
|
||||
typedef EGLNativePixmapType NativePixmapType;
|
||||
typedef EGLNativeWindowType NativeWindowType;
|
||||
|
||||
|
||||
/* Define EGLint. This must be a signed integral type large enough to contain
|
||||
* all legal attribute names and values passed into and out of EGL, whether
|
||||
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
|
||||
* handle, or other. While in general a 32-bit integer will suffice, if
|
||||
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
|
||||
* integer type.
|
||||
*/
|
||||
typedef khronos_int32_t EGLint;
|
||||
|
||||
|
||||
/* C++ / C typecast macros for special EGL handle values */
|
||||
#if defined(__cplusplus)
|
||||
#define EGL_CAST(type, value) (static_cast<type>(value))
|
||||
#else
|
||||
#define EGL_CAST(type, value) ((type) (value))
|
||||
#endif
|
||||
|
||||
#endif /* __eglplatform_h */
|
402
examples/ThirdPartyLibs/glad/egl.c
Normal file
402
examples/ThirdPartyLibs/glad/egl.c
Normal file
@ -0,0 +1,402 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glad/egl.h>
|
||||
|
||||
|
||||
int GLAD_EGL_VERSION_1_0;
|
||||
int GLAD_EGL_VERSION_1_1;
|
||||
int GLAD_EGL_VERSION_1_2;
|
||||
int GLAD_EGL_VERSION_1_3;
|
||||
int GLAD_EGL_VERSION_1_4;
|
||||
int GLAD_EGL_VERSION_1_5;
|
||||
int GLAD_EGL_EXT_device_base;
|
||||
int GLAD_EGL_EXT_device_enumeration;
|
||||
int GLAD_EGL_EXT_device_query;
|
||||
int GLAD_EGL_EXT_platform_base;
|
||||
int GLAD_EGL_EXT_platform_device;
|
||||
int GLAD_EGL_NV_cuda_event;
|
||||
int GLAD_EGL_NV_device_cuda;
|
||||
|
||||
|
||||
PFNEGLWAITNATIVEPROC glad_eglWaitNative;
|
||||
PFNEGLCREATEWINDOWSURFACEPROC glad_eglCreateWindowSurface;
|
||||
PFNEGLQUERYSTRINGPROC glad_eglQueryString;
|
||||
PFNEGLINITIALIZEPROC glad_eglInitialize;
|
||||
PFNEGLQUERYCONTEXTPROC glad_eglQueryContext;
|
||||
PFNEGLGETCURRENTSURFACEPROC glad_eglGetCurrentSurface;
|
||||
PFNEGLSWAPINTERVALPROC glad_eglSwapInterval;
|
||||
PFNEGLCREATESYNCPROC glad_eglCreateSync;
|
||||
PFNEGLCHOOSECONFIGPROC glad_eglChooseConfig;
|
||||
PFNEGLCREATEPIXMAPSURFACEPROC glad_eglCreatePixmapSurface;
|
||||
PFNEGLGETCONFIGATTRIBPROC glad_eglGetConfigAttrib;
|
||||
PFNEGLQUERYDEVICEATTRIBEXTPROC glad_eglQueryDeviceAttribEXT;
|
||||
PFNEGLCREATEPBUFFERSURFACEPROC glad_eglCreatePbufferSurface;
|
||||
PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC glad_eglCreatePbufferFromClientBuffer;
|
||||
PFNEGLMAKECURRENTPROC glad_eglMakeCurrent;
|
||||
PFNEGLGETPLATFORMDISPLAYPROC glad_eglGetPlatformDisplay;
|
||||
PFNEGLRELEASETEXIMAGEPROC glad_eglReleaseTexImage;
|
||||
PFNEGLGETERRORPROC glad_eglGetError;
|
||||
PFNEGLWAITSYNCPROC glad_eglWaitSync;
|
||||
PFNEGLWAITGLPROC glad_eglWaitGL;
|
||||
PFNEGLGETPROCADDRESSPROC glad_eglGetProcAddress;
|
||||
PFNEGLCREATECONTEXTPROC glad_eglCreateContext;
|
||||
PFNEGLDESTROYCONTEXTPROC glad_eglDestroyContext;
|
||||
PFNEGLBINDAPIPROC glad_eglBindAPI;
|
||||
PFNEGLGETCURRENTCONTEXTPROC glad_eglGetCurrentContext;
|
||||
PFNEGLGETCONFIGSPROC glad_eglGetConfigs;
|
||||
PFNEGLQUERYDEVICESTRINGEXTPROC glad_eglQueryDeviceStringEXT;
|
||||
PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC glad_eglCreatePlatformPixmapSurface;
|
||||
PFNEGLGETSYNCATTRIBPROC glad_eglGetSyncAttrib;
|
||||
PFNEGLGETPLATFORMDISPLAYEXTPROC glad_eglGetPlatformDisplayEXT;
|
||||
PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC glad_eglCreatePlatformWindowSurfaceEXT;
|
||||
PFNEGLBINDTEXIMAGEPROC glad_eglBindTexImage;
|
||||
PFNEGLCREATEPLATFORMWINDOWSURFACEPROC glad_eglCreatePlatformWindowSurface;
|
||||
PFNEGLCOPYBUFFERSPROC glad_eglCopyBuffers;
|
||||
PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC glad_eglCreatePlatformPixmapSurfaceEXT;
|
||||
PFNEGLGETDISPLAYPROC glad_eglGetDisplay;
|
||||
PFNEGLCREATEIMAGEPROC glad_eglCreateImage;
|
||||
PFNEGLWAITCLIENTPROC glad_eglWaitClient;
|
||||
PFNEGLGETCURRENTDISPLAYPROC glad_eglGetCurrentDisplay;
|
||||
PFNEGLTERMINATEPROC glad_eglTerminate;
|
||||
PFNEGLDESTROYIMAGEPROC glad_eglDestroyImage;
|
||||
PFNEGLQUERYDISPLAYATTRIBEXTPROC glad_eglQueryDisplayAttribEXT;
|
||||
PFNEGLQUERYSURFACEPROC glad_eglQuerySurface;
|
||||
PFNEGLSWAPBUFFERSPROC glad_eglSwapBuffers;
|
||||
PFNEGLCLIENTWAITSYNCPROC glad_eglClientWaitSync;
|
||||
PFNEGLRELEASETHREADPROC glad_eglReleaseThread;
|
||||
PFNEGLDESTROYSURFACEPROC glad_eglDestroySurface;
|
||||
PFNEGLQUERYDEVICESEXTPROC glad_eglQueryDevicesEXT;
|
||||
PFNEGLSURFACEATTRIBPROC glad_eglSurfaceAttrib;
|
||||
PFNEGLQUERYAPIPROC glad_eglQueryAPI;
|
||||
PFNEGLDESTROYSYNCPROC glad_eglDestroySync;
|
||||
|
||||
static void load_EGL_VERSION_1_0(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_VERSION_1_0) return;
|
||||
glad_eglWaitNative = (PFNEGLWAITNATIVEPROC)load("eglWaitNative", userptr);
|
||||
glad_eglCreateWindowSurface = (PFNEGLCREATEWINDOWSURFACEPROC)load("eglCreateWindowSurface", userptr);
|
||||
glad_eglQueryString = (PFNEGLQUERYSTRINGPROC)load("eglQueryString", userptr);
|
||||
glad_eglInitialize = (PFNEGLINITIALIZEPROC)load("eglInitialize", userptr);
|
||||
glad_eglQueryContext = (PFNEGLQUERYCONTEXTPROC)load("eglQueryContext", userptr);
|
||||
glad_eglGetCurrentSurface = (PFNEGLGETCURRENTSURFACEPROC)load("eglGetCurrentSurface", userptr);
|
||||
glad_eglChooseConfig = (PFNEGLCHOOSECONFIGPROC)load("eglChooseConfig", userptr);
|
||||
glad_eglCreatePixmapSurface = (PFNEGLCREATEPIXMAPSURFACEPROC)load("eglCreatePixmapSurface", userptr);
|
||||
glad_eglGetConfigAttrib = (PFNEGLGETCONFIGATTRIBPROC)load("eglGetConfigAttrib", userptr);
|
||||
glad_eglCreatePbufferSurface = (PFNEGLCREATEPBUFFERSURFACEPROC)load("eglCreatePbufferSurface", userptr);
|
||||
glad_eglMakeCurrent = (PFNEGLMAKECURRENTPROC)load("eglMakeCurrent", userptr);
|
||||
glad_eglGetError = (PFNEGLGETERRORPROC)load("eglGetError", userptr);
|
||||
glad_eglWaitGL = (PFNEGLWAITGLPROC)load("eglWaitGL", userptr);
|
||||
glad_eglGetProcAddress = (PFNEGLGETPROCADDRESSPROC)load("eglGetProcAddress", userptr);
|
||||
glad_eglCreateContext = (PFNEGLCREATECONTEXTPROC)load("eglCreateContext", userptr);
|
||||
glad_eglDestroyContext = (PFNEGLDESTROYCONTEXTPROC)load("eglDestroyContext", userptr);
|
||||
glad_eglGetConfigs = (PFNEGLGETCONFIGSPROC)load("eglGetConfigs", userptr);
|
||||
glad_eglCopyBuffers = (PFNEGLCOPYBUFFERSPROC)load("eglCopyBuffers", userptr);
|
||||
glad_eglGetDisplay = (PFNEGLGETDISPLAYPROC)load("eglGetDisplay", userptr);
|
||||
glad_eglGetCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC)load("eglGetCurrentDisplay", userptr);
|
||||
glad_eglQuerySurface = (PFNEGLQUERYSURFACEPROC)load("eglQuerySurface", userptr);
|
||||
glad_eglSwapBuffers = (PFNEGLSWAPBUFFERSPROC)load("eglSwapBuffers", userptr);
|
||||
glad_eglTerminate = (PFNEGLTERMINATEPROC)load("eglTerminate", userptr);
|
||||
glad_eglDestroySurface = (PFNEGLDESTROYSURFACEPROC)load("eglDestroySurface", userptr);
|
||||
}
|
||||
static void load_EGL_VERSION_1_1(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_VERSION_1_1) return;
|
||||
glad_eglSwapInterval = (PFNEGLSWAPINTERVALPROC)load("eglSwapInterval", userptr);
|
||||
glad_eglSurfaceAttrib = (PFNEGLSURFACEATTRIBPROC)load("eglSurfaceAttrib", userptr);
|
||||
glad_eglReleaseTexImage = (PFNEGLRELEASETEXIMAGEPROC)load("eglReleaseTexImage", userptr);
|
||||
glad_eglBindTexImage = (PFNEGLBINDTEXIMAGEPROC)load("eglBindTexImage", userptr);
|
||||
}
|
||||
static void load_EGL_VERSION_1_2(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_VERSION_1_2) return;
|
||||
glad_eglBindAPI = (PFNEGLBINDAPIPROC)load("eglBindAPI", userptr);
|
||||
glad_eglWaitClient = (PFNEGLWAITCLIENTPROC)load("eglWaitClient", userptr);
|
||||
glad_eglReleaseThread = (PFNEGLRELEASETHREADPROC)load("eglReleaseThread", userptr);
|
||||
glad_eglQueryAPI = (PFNEGLQUERYAPIPROC)load("eglQueryAPI", userptr);
|
||||
glad_eglCreatePbufferFromClientBuffer = (PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC)load("eglCreatePbufferFromClientBuffer", userptr);
|
||||
}
|
||||
static void load_EGL_VERSION_1_3(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_EGL_VERSION_1_4(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_VERSION_1_4) return;
|
||||
glad_eglGetCurrentContext = (PFNEGLGETCURRENTCONTEXTPROC)load("eglGetCurrentContext", userptr);
|
||||
}
|
||||
static void load_EGL_VERSION_1_5(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_VERSION_1_5) return;
|
||||
glad_eglCreatePlatformWindowSurface = (PFNEGLCREATEPLATFORMWINDOWSURFACEPROC)load("eglCreatePlatformWindowSurface", userptr);
|
||||
glad_eglWaitSync = (PFNEGLWAITSYNCPROC)load("eglWaitSync", userptr);
|
||||
glad_eglCreateImage = (PFNEGLCREATEIMAGEPROC)load("eglCreateImage", userptr);
|
||||
glad_eglDestroyImage = (PFNEGLDESTROYIMAGEPROC)load("eglDestroyImage", userptr);
|
||||
glad_eglGetPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYPROC)load("eglGetPlatformDisplay", userptr);
|
||||
glad_eglClientWaitSync = (PFNEGLCLIENTWAITSYNCPROC)load("eglClientWaitSync", userptr);
|
||||
glad_eglCreatePlatformPixmapSurface = (PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC)load("eglCreatePlatformPixmapSurface", userptr);
|
||||
glad_eglGetSyncAttrib = (PFNEGLGETSYNCATTRIBPROC)load("eglGetSyncAttrib", userptr);
|
||||
glad_eglDestroySync = (PFNEGLDESTROYSYNCPROC)load("eglDestroySync", userptr);
|
||||
glad_eglCreateSync = (PFNEGLCREATESYNCPROC)load("eglCreateSync", userptr);
|
||||
}
|
||||
static void load_EGL_EXT_device_base(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_EXT_device_base) return;
|
||||
glad_eglQueryDevicesEXT = (PFNEGLQUERYDEVICESEXTPROC)load("eglQueryDevicesEXT", userptr);
|
||||
glad_eglQueryDisplayAttribEXT = (PFNEGLQUERYDISPLAYATTRIBEXTPROC)load("eglQueryDisplayAttribEXT", userptr);
|
||||
glad_eglQueryDeviceAttribEXT = (PFNEGLQUERYDEVICEATTRIBEXTPROC)load("eglQueryDeviceAttribEXT", userptr);
|
||||
glad_eglQueryDeviceStringEXT = (PFNEGLQUERYDEVICESTRINGEXTPROC)load("eglQueryDeviceStringEXT", userptr);
|
||||
}
|
||||
static void load_EGL_EXT_device_enumeration(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_EXT_device_enumeration) return;
|
||||
glad_eglQueryDevicesEXT = (PFNEGLQUERYDEVICESEXTPROC)load("eglQueryDevicesEXT", userptr);
|
||||
}
|
||||
static void load_EGL_EXT_device_query(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_EXT_device_query) return;
|
||||
glad_eglQueryDeviceAttribEXT = (PFNEGLQUERYDEVICEATTRIBEXTPROC)load("eglQueryDeviceAttribEXT", userptr);
|
||||
glad_eglQueryDisplayAttribEXT = (PFNEGLQUERYDISPLAYATTRIBEXTPROC)load("eglQueryDisplayAttribEXT", userptr);
|
||||
glad_eglQueryDeviceStringEXT = (PFNEGLQUERYDEVICESTRINGEXTPROC)load("eglQueryDeviceStringEXT", userptr);
|
||||
}
|
||||
static void load_EGL_EXT_platform_base(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_EGL_EXT_platform_base) return;
|
||||
glad_eglCreatePlatformPixmapSurfaceEXT = (PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC)load("eglCreatePlatformPixmapSurfaceEXT", userptr);
|
||||
glad_eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)load("eglGetPlatformDisplayEXT", userptr);
|
||||
glad_eglCreatePlatformWindowSurfaceEXT = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)load("eglCreatePlatformWindowSurfaceEXT", userptr);
|
||||
}
|
||||
static void load_EGL_EXT_platform_device(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_EGL_NV_cuda_event(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_EGL_NV_device_cuda(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
|
||||
|
||||
static int get_exts(EGLDisplay display, const char **extensions) {
|
||||
*extensions = eglQueryString(display, EGL_EXTENSIONS);
|
||||
|
||||
return extensions != NULL;
|
||||
}
|
||||
|
||||
static int has_ext(const char *extensions, const char *name) {
|
||||
const char *loc;
|
||||
const char *terminator;
|
||||
if(extensions == NULL) {
|
||||
return 0;
|
||||
}
|
||||
while(1) {
|
||||
loc = strstr(extensions, extensions);
|
||||
if(loc == NULL) {
|
||||
return 0;
|
||||
}
|
||||
terminator = loc + strlen(extensions);
|
||||
if((loc == extensions || *(loc - 1) == ' ') &&
|
||||
(*terminator == ' ' || *terminator == '\0')) {
|
||||
return 1;
|
||||
}
|
||||
extensions = terminator;
|
||||
}
|
||||
}
|
||||
|
||||
static int find_extensionsEGL(EGLDisplay display) {
|
||||
const char *extensions;
|
||||
if (!get_exts(display, &extensions)) return 0;
|
||||
|
||||
GLAD_EGL_EXT_device_base = has_ext(extensions, "EGL_EXT_device_base");
|
||||
GLAD_EGL_EXT_device_enumeration = has_ext(extensions, "EGL_EXT_device_enumeration");
|
||||
GLAD_EGL_EXT_device_query = has_ext(extensions, "EGL_EXT_device_query");
|
||||
GLAD_EGL_EXT_platform_base = has_ext(extensions, "EGL_EXT_platform_base");
|
||||
GLAD_EGL_EXT_platform_device = has_ext(extensions, "EGL_EXT_platform_device");
|
||||
GLAD_EGL_NV_cuda_event = has_ext(extensions, "EGL_NV_cuda_event");
|
||||
GLAD_EGL_NV_device_cuda = has_ext(extensions, "EGL_NV_device_cuda");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int find_coreEGL(EGLDisplay display) {
|
||||
int major, minor;
|
||||
const char *version;
|
||||
|
||||
if (display == NULL) {
|
||||
display = EGL_NO_DISPLAY; /* this is usually NULL, better safe than sorry */
|
||||
}
|
||||
if (display == EGL_NO_DISPLAY) {
|
||||
display = eglGetCurrentDisplay();
|
||||
}
|
||||
if (display == EGL_NO_DISPLAY) {
|
||||
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
}
|
||||
if (display == EGL_NO_DISPLAY) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
version = eglQueryString(display, EGL_VERSION);
|
||||
(void) eglGetError();
|
||||
|
||||
if (version == NULL) {
|
||||
major = 1;
|
||||
minor = 0;
|
||||
} else {
|
||||
#ifdef _MSC_VER
|
||||
sscanf_s(version, "%d.%d", &major, &minor);
|
||||
#else
|
||||
sscanf(version, "%d.%d", &major, &minor);
|
||||
#endif
|
||||
}
|
||||
|
||||
GLAD_EGL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
|
||||
GLAD_EGL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
|
||||
GLAD_EGL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
|
||||
GLAD_EGL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
|
||||
GLAD_EGL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
|
||||
GLAD_EGL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1;
|
||||
|
||||
return major * 10 + minor;
|
||||
}
|
||||
|
||||
int gladLoadEGL(EGLDisplay display, GLADloadproc load, void* userptr) {
|
||||
int version;
|
||||
eglGetDisplay = (PFNEGLGETDISPLAYPROC)load("eglGetDisplay", userptr);
|
||||
eglGetCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC)load("eglGetCurrentDisplay", userptr);
|
||||
eglQueryString = (PFNEGLQUERYSTRINGPROC)load("eglQueryString", userptr);
|
||||
eglGetError = (PFNEGLGETERRORPROC)load("eglGetError", userptr);
|
||||
if (eglGetDisplay == NULL || eglGetCurrentDisplay == NULL || eglQueryString == NULL || eglGetError == NULL) return 0;
|
||||
|
||||
version = find_coreEGL(display);
|
||||
if (!version) return 0;
|
||||
load_EGL_VERSION_1_0(load, userptr);
|
||||
load_EGL_VERSION_1_1(load, userptr);
|
||||
load_EGL_VERSION_1_2(load, userptr);
|
||||
load_EGL_VERSION_1_3(load, userptr);
|
||||
load_EGL_VERSION_1_4(load, userptr);
|
||||
load_EGL_VERSION_1_5(load, userptr);
|
||||
|
||||
if (!find_extensionsEGL(display)) return 0;
|
||||
load_EGL_EXT_device_base(load, userptr);
|
||||
load_EGL_EXT_device_enumeration(load, userptr);
|
||||
load_EGL_EXT_device_query(load, userptr);
|
||||
load_EGL_EXT_platform_base(load, userptr);
|
||||
load_EGL_EXT_platform_device(load, userptr);
|
||||
load_EGL_NV_cuda_event(load, userptr);
|
||||
load_EGL_NV_device_cuda(load, userptr);
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
static void* glad_egl_get_proc_from_userptr(const char* name, void *userptr) {
|
||||
return ((void* (*)(const char *name))userptr)(name);
|
||||
}
|
||||
|
||||
int gladLoadEGLSimple(EGLDisplay display, GLADsimpleloadproc load) {
|
||||
return gladLoadEGL(display, glad_egl_get_proc_from_userptr, (void*) load);
|
||||
}
|
||||
|
||||
|
||||
#ifdef GLAD_EGL
|
||||
|
||||
#ifndef __glad_loader_library_c_
|
||||
#define __glad_loader_library_c_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
|
||||
static void* glad_get_dlopen_handle(const char *lib_names[], int length) {
|
||||
int i;
|
||||
void *handle;
|
||||
|
||||
for (i = 0; i < length; ++i) {
|
||||
#ifdef _WIN32
|
||||
handle = LoadLibraryA(lib_names[i]);
|
||||
#else
|
||||
handle = dlopen(lib_names[i], RTLD_LAZY | RTLD_LOCAL);
|
||||
#endif
|
||||
if (handle != NULL) {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void glad_close_dlopen_handle(void* handle) {
|
||||
if (handle != NULL) {
|
||||
#ifdef _WIN32
|
||||
FreeLibrary((HMODULE) handle);
|
||||
#else
|
||||
dlclose(handle);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void* glad_dlsym_handle(void* handle, const char *name) {
|
||||
if (handle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
return (void*) GetProcAddress((HMODULE) handle, name);
|
||||
#else
|
||||
return dlsym(handle, name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* __glad_loader_library_c_ */
|
||||
typedef __eglMustCastToProperFunctionPointerType (APIENTRYP GLAD_EGL_PFNGETPROCADDRESSPROC_PRIVATE)(const char*);
|
||||
struct _glad_egl_userptr {
|
||||
void *handle;
|
||||
GLAD_EGL_PFNGETPROCADDRESSPROC_PRIVATE get_proc_address_ptr;
|
||||
};
|
||||
|
||||
static void* glad_egl_get_proc(const char* name, void *vuserptr) {
|
||||
struct _glad_egl_userptr userptr = *(struct _glad_egl_userptr*) vuserptr;
|
||||
void* result = NULL;
|
||||
|
||||
result = (void*) glad_dlsym_handle(userptr.handle, name);
|
||||
if (result == NULL) {
|
||||
result = (void*) userptr.get_proc_address_ptr(name);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void* _egl_handle = NULL;
|
||||
|
||||
int gladLoadEGLInternalLoader(EGLDisplay display) {
|
||||
#ifdef __APPLE__
|
||||
static const char *NAMES[] = {"libEGL.dylib"};
|
||||
#elif defined _WIN32
|
||||
static const char *NAMES[] = {"libEGL.dll", "EGL.dll"};
|
||||
#else
|
||||
static const char *NAMES[] = {"libEGL.so.1", "libEGL.so"};
|
||||
#endif
|
||||
|
||||
int version = 0;
|
||||
int did_load = 0;
|
||||
struct _glad_egl_userptr userptr;
|
||||
|
||||
if (_egl_handle == NULL) {
|
||||
_egl_handle = glad_get_dlopen_handle(NAMES, sizeof(NAMES) / sizeof(NAMES[0]));
|
||||
did_load = _egl_handle != NULL;
|
||||
}
|
||||
|
||||
if (_egl_handle != NULL) {
|
||||
userptr.handle = _egl_handle;
|
||||
userptr.get_proc_address_ptr = (GLAD_EGL_PFNGETPROCADDRESSPROC_PRIVATE) glad_dlsym_handle(_egl_handle, "eglGetProcAddress");
|
||||
if (userptr.get_proc_address_ptr != NULL) {
|
||||
version = gladLoadEGL(display, (GLADloadproc) glad_egl_get_proc, &userptr);
|
||||
}
|
||||
|
||||
if (!version && did_load) {
|
||||
glad_close_dlopen_handle(_egl_handle);
|
||||
_egl_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
void gladUnloadEGLInternalLoader() {
|
||||
if (_egl_handle != NULL) {
|
||||
glad_close_dlopen_handle(_egl_handle);
|
||||
_egl_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* GLAD_EGL */
|
2513
examples/ThirdPartyLibs/glad/gl.c
Normal file
2513
examples/ThirdPartyLibs/glad/gl.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
469
examples/ThirdPartyLibs/glad/glad/egl.h
Normal file
469
examples/ThirdPartyLibs/glad/glad/egl.h
Normal file
@ -0,0 +1,469 @@
|
||||
#ifndef __glad_egl_h_
|
||||
#define __glad_egl_h_
|
||||
|
||||
#ifdef __egl_h_
|
||||
#error EGL header already included (API: egl), remove previous include!
|
||||
#endif
|
||||
#define __egl_h_
|
||||
|
||||
|
||||
#define GLAD_EGL
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef GLAPI
|
||||
# if defined(GLAD_GLAPI_EXPORT)
|
||||
# if defined(_WIN32) || defined(__CYGWIN__)
|
||||
# if defined(GLAD_GLAPI_EXPORT_BUILD)
|
||||
# if defined(__GNUC__)
|
||||
# define GLAPI __attribute__ ((dllexport)) extern
|
||||
# else
|
||||
# define GLAPI __declspec(dllexport) extern
|
||||
# endif
|
||||
# else
|
||||
# if defined(__GNUC__)
|
||||
# define GLAPI __attribute__ ((dllimport)) extern
|
||||
# else
|
||||
# define GLAPI __declspec(dllimport) extern
|
||||
# endif
|
||||
# endif
|
||||
# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD)
|
||||
# define GLAPI __attribute__ ((visibility ("default"))) extern
|
||||
# else
|
||||
# define GLAPI extern
|
||||
# endif
|
||||
# else
|
||||
# define GLAPI extern
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define EGL_VERSION_1_0 1
|
||||
GLAPI int GLAD_EGL_VERSION_1_0;
|
||||
#define EGL_VERSION_1_1 1
|
||||
GLAPI int GLAD_EGL_VERSION_1_1;
|
||||
#define EGL_VERSION_1_2 1
|
||||
GLAPI int GLAD_EGL_VERSION_1_2;
|
||||
#define EGL_VERSION_1_3 1
|
||||
GLAPI int GLAD_EGL_VERSION_1_3;
|
||||
#define EGL_VERSION_1_4 1
|
||||
GLAPI int GLAD_EGL_VERSION_1_4;
|
||||
#define EGL_VERSION_1_5 1
|
||||
GLAPI int GLAD_EGL_VERSION_1_5;
|
||||
#define EGL_EXT_device_base 1
|
||||
GLAPI int GLAD_EGL_EXT_device_base;
|
||||
#define EGL_EXT_device_enumeration 1
|
||||
GLAPI int GLAD_EGL_EXT_device_enumeration;
|
||||
#define EGL_EXT_device_query 1
|
||||
GLAPI int GLAD_EGL_EXT_device_query;
|
||||
#define EGL_EXT_platform_base 1
|
||||
GLAPI int GLAD_EGL_EXT_platform_base;
|
||||
#define EGL_EXT_platform_device 1
|
||||
GLAPI int GLAD_EGL_EXT_platform_device;
|
||||
#define EGL_NV_cuda_event 1
|
||||
GLAPI int GLAD_EGL_NV_cuda_event;
|
||||
#define EGL_NV_device_cuda 1
|
||||
GLAPI int GLAD_EGL_NV_device_cuda;
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
struct AHardwareBuffer;
|
||||
typedef unsigned int EGLBoolean;
|
||||
typedef unsigned int EGLenum;
|
||||
typedef intptr_t EGLAttribKHR;
|
||||
typedef intptr_t EGLAttrib;
|
||||
typedef void *EGLClientBuffer;
|
||||
typedef void *EGLConfig;
|
||||
typedef void *EGLContext;
|
||||
typedef void *EGLDeviceEXT;
|
||||
typedef void *EGLDisplay;
|
||||
typedef void *EGLImage;
|
||||
typedef void *EGLImageKHR;
|
||||
typedef void *EGLLabelKHR;
|
||||
typedef void *EGLObjectKHR;
|
||||
typedef void *EGLOutputLayerEXT;
|
||||
typedef void *EGLOutputPortEXT;
|
||||
typedef void *EGLStreamKHR;
|
||||
typedef void *EGLSurface;
|
||||
typedef void *EGLSync;
|
||||
typedef void *EGLSyncKHR;
|
||||
typedef void *EGLSyncNV;
|
||||
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
|
||||
typedef khronos_utime_nanoseconds_t EGLTime;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeNV;
|
||||
typedef khronos_utime_nanoseconds_t EGLuint64NV;
|
||||
typedef khronos_uint64_t EGLuint64KHR;
|
||||
typedef khronos_stime_nanoseconds_t EGLnsecsANDROID;
|
||||
typedef int EGLNativeFileDescriptorKHR;
|
||||
typedef khronos_ssize_t EGLsizeiANDROID;
|
||||
typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
|
||||
typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
|
||||
struct EGLClientPixmapHI {
|
||||
void *pData;
|
||||
EGLint iWidth;
|
||||
EGLint iHeight;
|
||||
EGLint iStride;
|
||||
};
|
||||
typedef void (APIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message);
|
||||
|
||||
#define EGL_FALSE 0
|
||||
#define EGL_BACK_BUFFER 0x3084
|
||||
#define EGL_GL_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
|
||||
#define EGL_TEXTURE_RGB 0x305D
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C
|
||||
#define EGL_LEVEL 0x3029
|
||||
#define EGL_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_DONT_CARE EGL_CAST(EGLint,-1)
|
||||
#define EGL_OPENVG_IMAGE 0x3096
|
||||
#define EGL_ALPHA_FORMAT_PRE 0x308C
|
||||
#define EGL_SLOW_CONFIG 0x3050
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
|
||||
#define EGL_GREEN_SIZE 0x3023
|
||||
#define EGL_CONTEXT_MINOR_VERSION 0x30FB
|
||||
#define EGL_CUDA_DEVICE_NV 0x323A
|
||||
#define EGL_BAD_CONFIG 0x3005
|
||||
#define EGL_RENDERABLE_TYPE 0x3040
|
||||
#define EGL_CONDITION_SATISFIED 0x30F6
|
||||
#define EGL_OPENGL_ES_BIT 0x0001
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
#define EGL_DEFAULT_DISPLAY EGL_CAST(EGLNativeDisplayType,0)
|
||||
#define EGL_BAD_PARAMETER 0x300C
|
||||
#define EGL_DEPTH_SIZE 0x3025
|
||||
#define EGL_CONTEXT_MAJOR_VERSION 0x3098
|
||||
#define EGL_HEIGHT 0x3056
|
||||
#define EGL_OPENGL_ES3_BIT 0x00000040
|
||||
#define EGL_BAD_ALLOC 0x3003
|
||||
#define EGL_BAD_DISPLAY 0x3008
|
||||
#define EGL_CLIENT_APIS 0x308D
|
||||
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B
|
||||
#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
|
||||
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
|
||||
#define EGL_SURFACE_TYPE 0x3033
|
||||
#define EGL_VENDOR 0x3053
|
||||
#define EGL_GL_COLORSPACE 0x309D
|
||||
#define EGL_BAD_SURFACE 0x300D
|
||||
#define EGL_GL_RENDERBUFFER 0x30B9
|
||||
#define EGL_SAMPLE_BUFFERS 0x3032
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040
|
||||
#define EGL_VG_ALPHA_FORMAT 0x3088
|
||||
#define EGL_PIXMAP_BIT 0x0002
|
||||
#define EGL_NATIVE_RENDERABLE 0x302D
|
||||
#define EGL_TEXTURE_RGBA 0x305E
|
||||
#define EGL_NATIVE_VISUAL_ID 0x302E
|
||||
#define EGL_VERSION 0x3054
|
||||
#define EGL_TRANSPARENT_RED_VALUE 0x3037
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
|
||||
#define EGL_BLUE_SIZE 0x3022
|
||||
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
|
||||
#define EGL_PIXEL_ASPECT_RATIO 0x3092
|
||||
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
|
||||
#define EGL_STENCIL_SIZE 0x3026
|
||||
#define EGL_CONFORMANT 0x3042
|
||||
#define EGL_EXTENSIONS 0x3055
|
||||
#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF
|
||||
#define EGL_BAD_ATTRIBUTE 0x3004
|
||||
#define EGL_NO_DISPLAY EGL_CAST(EGLDisplay,0)
|
||||
#define EGL_TEXTURE_TARGET 0x3081
|
||||
#define EGL_IMAGE_PRESERVED 0x30D2
|
||||
#define EGL_COLOR_BUFFER_TYPE 0x303F
|
||||
#define EGL_VG_COLORSPACE_sRGB 0x3089
|
||||
#define EGL_GL_TEXTURE_3D 0x30B2
|
||||
#define EGL_MULTISAMPLE_RESOLVE 0x3099
|
||||
#define EGL_CL_EVENT_HANDLE 0x309C
|
||||
#define EGL_GL_TEXTURE_2D 0x30B1
|
||||
#define EGL_CORE_NATIVE_ENGINE 0x305B
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
|
||||
#define EGL_UNKNOWN EGL_CAST(EGLint,-1)
|
||||
#define EGL_TRANSPARENT_TYPE 0x3034
|
||||
#define EGL_LUMINANCE_SIZE 0x303D
|
||||
#define EGL_LARGEST_PBUFFER 0x3058
|
||||
#define EGL_VG_COLORSPACE 0x3087
|
||||
#define EGL_GL_COLORSPACE_SRGB 0x3089
|
||||
#define EGL_LUMINANCE_BUFFER 0x308F
|
||||
#define EGL_FOREVER 0xFFFFFFFFFFFFFFFF
|
||||
#define EGL_NO_SYNC EGL_CAST(EGLSync,0)
|
||||
#define EGL_WIDTH 0x3057
|
||||
#define EGL_ALPHA_FORMAT_NONPRE 0x308B
|
||||
#define EGL_BUFFER_SIZE 0x3020
|
||||
#define EGL_NO_CONTEXT EGL_CAST(EGLContext,0)
|
||||
#define EGL_MIPMAP_LEVEL 0x3083
|
||||
#define EGL_NO_TEXTURE 0x305C
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200
|
||||
#define EGL_SINGLE_BUFFER 0x3085
|
||||
#define EGL_NONE 0x3038
|
||||
#define EGL_NOT_INITIALIZED 0x3001
|
||||
#define EGL_VG_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
|
||||
#define EGL_OPENVG_API 0x30A1
|
||||
#define EGL_DRAW 0x3059
|
||||
#define EGL_OPENGL_BIT 0x0008
|
||||
#define EGL_PBUFFER_BIT 0x0001
|
||||
#define EGL_ALPHA_SIZE 0x3021
|
||||
#define EGL_TRANSPARENT_RGB 0x3052
|
||||
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
|
||||
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||
#define EGL_SIGNALED 0x30F2
|
||||
#define EGL_CONFIG_ID 0x3028
|
||||
#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D
|
||||
#define EGL_GL_TEXTURE_LEVEL 0x30BC
|
||||
#define EGL_BAD_ACCESS 0x3002
|
||||
#define EGL_MAX_PBUFFER_PIXELS 0x302B
|
||||
#define EGL_DEVICE_EXT 0x322C
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
|
||||
#define EGL_ALPHA_FORMAT 0x3088
|
||||
#define EGL_TRUE 1
|
||||
#define EGL_MIPMAP_TEXTURE 0x3082
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF
|
||||
#define EGL_GL_TEXTURE_ZOFFSET 0x30BD
|
||||
#define EGL_MIN_SWAP_INTERVAL 0x303B
|
||||
#define EGL_BAD_CURRENT_SURFACE 0x3007
|
||||
#define EGL_RED_SIZE 0x3024
|
||||
#define EGL_BAD_DEVICE_EXT 0x322B
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001
|
||||
#define EGL_PLATFORM_DEVICE_EXT 0x313F
|
||||
#define EGL_READ 0x305A
|
||||
#define EGL_OPENGL_ES_API 0x30A0
|
||||
#define EGL_OPENGL_API 0x30A2
|
||||
#define EGL_SYNC_TYPE 0x30F7
|
||||
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0
|
||||
#define EGL_MAX_SWAP_INTERVAL 0x303C
|
||||
#define EGL_RGB_BUFFER 0x308E
|
||||
#define EGL_OPENGL_ES2_BIT 0x0004
|
||||
#define EGL_BAD_NATIVE_WINDOW 0x300B
|
||||
#define EGL_CONTEXT_LOST 0x300E
|
||||
#define EGL_TIMEOUT_EXPIRED 0x30F5
|
||||
#define EGL_TEXTURE_2D 0x305F
|
||||
#define EGL_RENDER_BUFFER 0x3086
|
||||
#define EGL_BAD_NATIVE_PIXMAP 0x300A
|
||||
#define EGL_MATCH_NATIVE_PIXMAP 0x3041
|
||||
#define EGL_NO_IMAGE EGL_CAST(EGLImage,0)
|
||||
#define EGL_SUCCESS 0x3000
|
||||
#define EGL_OPENVG_BIT 0x0002
|
||||
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
|
||||
#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0
|
||||
#define EGL_BAD_CONTEXT 0x3006
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020
|
||||
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
|
||||
#define EGL_ALPHA_MASK_SIZE 0x303E
|
||||
#define EGL_CONFIG_CAVEAT 0x3027
|
||||
#define EGL_BAD_MATCH 0x3009
|
||||
#define EGL_SYNC_CL_EVENT 0x30FE
|
||||
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
|
||||
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||
#define EGL_CUDA_EVENT_HANDLE_NV 0x323B
|
||||
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
|
||||
#define EGL_COLORSPACE 0x3087
|
||||
#define EGL_TEXTURE_FORMAT 0x3080
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B
|
||||
#define EGL_SYNC_STATUS 0x30F1
|
||||
#define EGL_UNSIGNALED 0x30F3
|
||||
#define EGL_SYNC_CUDA_EVENT_NV 0x323C
|
||||
#define EGL_NO_SURFACE EGL_CAST(EGLSurface,0)
|
||||
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
|
||||
#define EGL_WINDOW_BIT 0x0004
|
||||
#define EGL_NATIVE_VISUAL_TYPE 0x302F
|
||||
#define EGL_SAMPLES 0x3031
|
||||
#define EGL_SYNC_CONDITION 0x30F8
|
||||
#define EGL_NON_CONFORMANT_CONFIG 0x3051
|
||||
#define EGL_HORIZONTAL_RESOLUTION 0x3090
|
||||
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A
|
||||
#define EGL_NO_DEVICE_EXT EGL_CAST(EGLDeviceEXT,0)
|
||||
#define EGL_SYNC_FENCE 0x30F9
|
||||
#define EGL_DISPLAY_SCALING 10000
|
||||
#define EGL_BUFFER_DESTROYED 0x3095
|
||||
#define EGL_MAX_PBUFFER_WIDTH 0x302C
|
||||
#define EGL_BUFFER_PRESERVED 0x3094
|
||||
#define EGL_COLORSPACE_sRGB 0x3089
|
||||
#define EGL_NO_RESET_NOTIFICATION 0x31BE
|
||||
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLWAITNATIVEPROC)(EGLint engine);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLCREATEWINDOWSURFACEPROC)(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
|
||||
typedef const char * (APIENTRYP PFNEGLQUERYSTRINGPROC)(EGLDisplay dpy, EGLint name);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLINITIALIZEPROC)(EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLQUERYCONTEXTPROC)(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLGETCURRENTSURFACEPROC)(EGLint readdraw);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLSWAPINTERVALPROC)(EGLDisplay dpy, EGLint interval);
|
||||
typedef EGLSync (APIENTRYP PFNEGLCREATESYNCPROC)(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLCHOOSECONFIGPROC)(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLCREATEPIXMAPSURFACEPROC)(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLGETCONFIGATTRIBPROC)(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC)(EGLDeviceEXT device, EGLint attribute, EGLAttrib *value);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLCREATEPBUFFERSURFACEPROC)(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC)(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLMAKECURRENTPROC)(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
|
||||
typedef EGLDisplay (APIENTRYP PFNEGLGETPLATFORMDISPLAYPROC)(EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLRELEASETEXIMAGEPROC)(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
typedef EGLint (APIENTRYP PFNEGLGETERRORPROC)();
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLWAITSYNCPROC)(EGLDisplay dpy, EGLSync sync, EGLint flags);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLWAITGLPROC)();
|
||||
typedef __eglMustCastToProperFunctionPointerType (APIENTRYP PFNEGLGETPROCADDRESSPROC)(const char *procname);
|
||||
typedef EGLContext (APIENTRYP PFNEGLCREATECONTEXTPROC)(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLDESTROYCONTEXTPROC)(EGLDisplay dpy, EGLContext ctx);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLBINDAPIPROC)(EGLenum api);
|
||||
typedef EGLContext (APIENTRYP PFNEGLGETCURRENTCONTEXTPROC)();
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLGETCONFIGSPROC)(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
typedef const char * (APIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC)(EGLDeviceEXT device, EGLint name);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC)(EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLGETSYNCATTRIBPROC)(EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
|
||||
typedef EGLDisplay (APIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform, void *native_display, const EGLint *attrib_list);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLBINDTEXIMAGEPROC)(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC)(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLCOPYBUFFERSPROC)(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
|
||||
typedef EGLSurface (APIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC)(EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list);
|
||||
typedef EGLDisplay (APIENTRYP PFNEGLGETDISPLAYPROC)(EGLNativeDisplayType display_id);
|
||||
typedef EGLImage (APIENTRYP PFNEGLCREATEIMAGEPROC)(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLWAITCLIENTPROC)();
|
||||
typedef EGLDisplay (APIENTRYP PFNEGLGETCURRENTDISPLAYPROC)();
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLTERMINATEPROC)(EGLDisplay dpy);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLDESTROYIMAGEPROC)(EGLDisplay dpy, EGLImage image);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC)(EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLQUERYSURFACEPROC)(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLSWAPBUFFERSPROC)(EGLDisplay dpy, EGLSurface surface);
|
||||
typedef EGLint (APIENTRYP PFNEGLCLIENTWAITSYNCPROC)(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLRELEASETHREADPROC)();
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLDESTROYSURFACEPROC)(EGLDisplay dpy, EGLSurface surface);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLQUERYDEVICESEXTPROC)(EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices);
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLSURFACEATTRIBPROC)(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
|
||||
typedef EGLenum (APIENTRYP PFNEGLQUERYAPIPROC)();
|
||||
typedef EGLBoolean (APIENTRYP PFNEGLDESTROYSYNCPROC)(EGLDisplay dpy, EGLSync sync);
|
||||
|
||||
GLAPI PFNEGLWAITNATIVEPROC glad_eglWaitNative;
|
||||
#define eglWaitNative glad_eglWaitNative
|
||||
GLAPI PFNEGLCREATEWINDOWSURFACEPROC glad_eglCreateWindowSurface;
|
||||
#define eglCreateWindowSurface glad_eglCreateWindowSurface
|
||||
GLAPI PFNEGLQUERYSTRINGPROC glad_eglQueryString;
|
||||
#define eglQueryString glad_eglQueryString
|
||||
GLAPI PFNEGLINITIALIZEPROC glad_eglInitialize;
|
||||
#define eglInitialize glad_eglInitialize
|
||||
GLAPI PFNEGLQUERYCONTEXTPROC glad_eglQueryContext;
|
||||
#define eglQueryContext glad_eglQueryContext
|
||||
GLAPI PFNEGLGETCURRENTSURFACEPROC glad_eglGetCurrentSurface;
|
||||
#define eglGetCurrentSurface glad_eglGetCurrentSurface
|
||||
GLAPI PFNEGLSWAPINTERVALPROC glad_eglSwapInterval;
|
||||
#define eglSwapInterval glad_eglSwapInterval
|
||||
GLAPI PFNEGLCREATESYNCPROC glad_eglCreateSync;
|
||||
#define eglCreateSync glad_eglCreateSync
|
||||
GLAPI PFNEGLCHOOSECONFIGPROC glad_eglChooseConfig;
|
||||
#define eglChooseConfig glad_eglChooseConfig
|
||||
GLAPI PFNEGLCREATEPIXMAPSURFACEPROC glad_eglCreatePixmapSurface;
|
||||
#define eglCreatePixmapSurface glad_eglCreatePixmapSurface
|
||||
GLAPI PFNEGLGETCONFIGATTRIBPROC glad_eglGetConfigAttrib;
|
||||
#define eglGetConfigAttrib glad_eglGetConfigAttrib
|
||||
GLAPI PFNEGLQUERYDEVICEATTRIBEXTPROC glad_eglQueryDeviceAttribEXT;
|
||||
#define eglQueryDeviceAttribEXT glad_eglQueryDeviceAttribEXT
|
||||
GLAPI PFNEGLCREATEPBUFFERSURFACEPROC glad_eglCreatePbufferSurface;
|
||||
#define eglCreatePbufferSurface glad_eglCreatePbufferSurface
|
||||
GLAPI PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC glad_eglCreatePbufferFromClientBuffer;
|
||||
#define eglCreatePbufferFromClientBuffer glad_eglCreatePbufferFromClientBuffer
|
||||
GLAPI PFNEGLMAKECURRENTPROC glad_eglMakeCurrent;
|
||||
#define eglMakeCurrent glad_eglMakeCurrent
|
||||
GLAPI PFNEGLGETPLATFORMDISPLAYPROC glad_eglGetPlatformDisplay;
|
||||
#define eglGetPlatformDisplay glad_eglGetPlatformDisplay
|
||||
GLAPI PFNEGLRELEASETEXIMAGEPROC glad_eglReleaseTexImage;
|
||||
#define eglReleaseTexImage glad_eglReleaseTexImage
|
||||
GLAPI PFNEGLGETERRORPROC glad_eglGetError;
|
||||
#define eglGetError glad_eglGetError
|
||||
GLAPI PFNEGLWAITSYNCPROC glad_eglWaitSync;
|
||||
#define eglWaitSync glad_eglWaitSync
|
||||
GLAPI PFNEGLWAITGLPROC glad_eglWaitGL;
|
||||
#define eglWaitGL glad_eglWaitGL
|
||||
GLAPI PFNEGLGETPROCADDRESSPROC glad_eglGetProcAddress;
|
||||
#define eglGetProcAddress glad_eglGetProcAddress
|
||||
GLAPI PFNEGLCREATECONTEXTPROC glad_eglCreateContext;
|
||||
#define eglCreateContext glad_eglCreateContext
|
||||
GLAPI PFNEGLDESTROYCONTEXTPROC glad_eglDestroyContext;
|
||||
#define eglDestroyContext glad_eglDestroyContext
|
||||
GLAPI PFNEGLBINDAPIPROC glad_eglBindAPI;
|
||||
#define eglBindAPI glad_eglBindAPI
|
||||
GLAPI PFNEGLGETCURRENTCONTEXTPROC glad_eglGetCurrentContext;
|
||||
#define eglGetCurrentContext glad_eglGetCurrentContext
|
||||
GLAPI PFNEGLGETCONFIGSPROC glad_eglGetConfigs;
|
||||
#define eglGetConfigs glad_eglGetConfigs
|
||||
GLAPI PFNEGLQUERYDEVICESTRINGEXTPROC glad_eglQueryDeviceStringEXT;
|
||||
#define eglQueryDeviceStringEXT glad_eglQueryDeviceStringEXT
|
||||
GLAPI PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC glad_eglCreatePlatformPixmapSurface;
|
||||
#define eglCreatePlatformPixmapSurface glad_eglCreatePlatformPixmapSurface
|
||||
GLAPI PFNEGLGETSYNCATTRIBPROC glad_eglGetSyncAttrib;
|
||||
#define eglGetSyncAttrib glad_eglGetSyncAttrib
|
||||
GLAPI PFNEGLGETPLATFORMDISPLAYEXTPROC glad_eglGetPlatformDisplayEXT;
|
||||
#define eglGetPlatformDisplayEXT glad_eglGetPlatformDisplayEXT
|
||||
GLAPI PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC glad_eglCreatePlatformWindowSurfaceEXT;
|
||||
#define eglCreatePlatformWindowSurfaceEXT glad_eglCreatePlatformWindowSurfaceEXT
|
||||
GLAPI PFNEGLBINDTEXIMAGEPROC glad_eglBindTexImage;
|
||||
#define eglBindTexImage glad_eglBindTexImage
|
||||
GLAPI PFNEGLCREATEPLATFORMWINDOWSURFACEPROC glad_eglCreatePlatformWindowSurface;
|
||||
#define eglCreatePlatformWindowSurface glad_eglCreatePlatformWindowSurface
|
||||
GLAPI PFNEGLCOPYBUFFERSPROC glad_eglCopyBuffers;
|
||||
#define eglCopyBuffers glad_eglCopyBuffers
|
||||
GLAPI PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC glad_eglCreatePlatformPixmapSurfaceEXT;
|
||||
#define eglCreatePlatformPixmapSurfaceEXT glad_eglCreatePlatformPixmapSurfaceEXT
|
||||
GLAPI PFNEGLGETDISPLAYPROC glad_eglGetDisplay;
|
||||
#define eglGetDisplay glad_eglGetDisplay
|
||||
GLAPI PFNEGLCREATEIMAGEPROC glad_eglCreateImage;
|
||||
#define eglCreateImage glad_eglCreateImage
|
||||
GLAPI PFNEGLWAITCLIENTPROC glad_eglWaitClient;
|
||||
#define eglWaitClient glad_eglWaitClient
|
||||
GLAPI PFNEGLGETCURRENTDISPLAYPROC glad_eglGetCurrentDisplay;
|
||||
#define eglGetCurrentDisplay glad_eglGetCurrentDisplay
|
||||
GLAPI PFNEGLTERMINATEPROC glad_eglTerminate;
|
||||
#define eglTerminate glad_eglTerminate
|
||||
GLAPI PFNEGLDESTROYIMAGEPROC glad_eglDestroyImage;
|
||||
#define eglDestroyImage glad_eglDestroyImage
|
||||
GLAPI PFNEGLQUERYDISPLAYATTRIBEXTPROC glad_eglQueryDisplayAttribEXT;
|
||||
#define eglQueryDisplayAttribEXT glad_eglQueryDisplayAttribEXT
|
||||
GLAPI PFNEGLQUERYSURFACEPROC glad_eglQuerySurface;
|
||||
#define eglQuerySurface glad_eglQuerySurface
|
||||
GLAPI PFNEGLSWAPBUFFERSPROC glad_eglSwapBuffers;
|
||||
#define eglSwapBuffers glad_eglSwapBuffers
|
||||
GLAPI PFNEGLCLIENTWAITSYNCPROC glad_eglClientWaitSync;
|
||||
#define eglClientWaitSync glad_eglClientWaitSync
|
||||
GLAPI PFNEGLRELEASETHREADPROC glad_eglReleaseThread;
|
||||
#define eglReleaseThread glad_eglReleaseThread
|
||||
GLAPI PFNEGLDESTROYSURFACEPROC glad_eglDestroySurface;
|
||||
#define eglDestroySurface glad_eglDestroySurface
|
||||
GLAPI PFNEGLQUERYDEVICESEXTPROC glad_eglQueryDevicesEXT;
|
||||
#define eglQueryDevicesEXT glad_eglQueryDevicesEXT
|
||||
GLAPI PFNEGLSURFACEATTRIBPROC glad_eglSurfaceAttrib;
|
||||
#define eglSurfaceAttrib glad_eglSurfaceAttrib
|
||||
GLAPI PFNEGLQUERYAPIPROC glad_eglQueryAPI;
|
||||
#define eglQueryAPI glad_eglQueryAPI
|
||||
GLAPI PFNEGLDESTROYSYNCPROC glad_eglDestroySync;
|
||||
#define eglDestroySync glad_eglDestroySync
|
||||
|
||||
|
||||
typedef void* (* GLADloadproc)(const char *name, void* userptr);
|
||||
typedef void* (* GLADsimpleloadproc)(const char *name);
|
||||
GLAPI int gladLoadEGL(EGLDisplay display, GLADloadproc load, void* userptr);
|
||||
GLAPI int gladLoadEGLSimple(EGLDisplay display, GLADsimpleloadproc load);
|
||||
|
||||
|
||||
#ifdef GLAD_EGL
|
||||
|
||||
GLAPI int gladLoadEGLInternalLoader(EGLDisplay display);
|
||||
|
||||
GLAPI void gladUnloadEGLInternalLoader(void);
|
||||
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,837 +0,0 @@
|
||||
/*
|
||||
|
||||
GLX loader generated by glad 0.1.16a0 on Tue Feb 20 13:09:25 2018.
|
||||
|
||||
Language/Generator: C/C++
|
||||
Specification: glx
|
||||
APIs: glx=1.4
|
||||
Profile: -
|
||||
Extensions:
|
||||
GLX_3DFX_multisample,
|
||||
GLX_AMD_gpu_association,
|
||||
GLX_ARB_context_flush_control,
|
||||
GLX_ARB_create_context,
|
||||
GLX_ARB_create_context_no_error,
|
||||
GLX_ARB_create_context_profile,
|
||||
GLX_ARB_create_context_robustness,
|
||||
GLX_ARB_fbconfig_float,
|
||||
GLX_ARB_framebuffer_sRGB,
|
||||
GLX_ARB_get_proc_address,
|
||||
GLX_ARB_multisample,
|
||||
GLX_ARB_robustness_application_isolation,
|
||||
GLX_ARB_robustness_share_group_isolation,
|
||||
GLX_ARB_vertex_buffer_object,
|
||||
GLX_EXT_buffer_age,
|
||||
GLX_EXT_create_context_es2_profile,
|
||||
GLX_EXT_create_context_es_profile,
|
||||
GLX_EXT_fbconfig_packed_float,
|
||||
GLX_EXT_framebuffer_sRGB,
|
||||
GLX_EXT_import_context,
|
||||
GLX_EXT_libglvnd,
|
||||
GLX_EXT_no_config_context,
|
||||
GLX_EXT_stereo_tree,
|
||||
GLX_EXT_swap_control,
|
||||
GLX_EXT_swap_control_tear,
|
||||
GLX_EXT_texture_from_pixmap,
|
||||
GLX_EXT_visual_info,
|
||||
GLX_EXT_visual_rating,
|
||||
GLX_INTEL_swap_event,
|
||||
GLX_MESA_agp_offset,
|
||||
GLX_MESA_copy_sub_buffer,
|
||||
GLX_MESA_pixmap_colormap,
|
||||
GLX_MESA_query_renderer,
|
||||
GLX_MESA_release_buffers,
|
||||
GLX_MESA_set_3dfx_mode,
|
||||
GLX_MESA_swap_control,
|
||||
GLX_NV_copy_buffer,
|
||||
GLX_NV_copy_image,
|
||||
GLX_NV_delay_before_swap,
|
||||
GLX_NV_float_buffer,
|
||||
GLX_NV_multisample_coverage,
|
||||
GLX_NV_present_video,
|
||||
GLX_NV_robustness_video_memory_purge,
|
||||
GLX_NV_swap_group,
|
||||
GLX_NV_video_capture,
|
||||
GLX_NV_video_out,
|
||||
GLX_OML_swap_method,
|
||||
GLX_OML_sync_control,
|
||||
GLX_SGIS_blended_overlay,
|
||||
GLX_SGIS_multisample,
|
||||
GLX_SGIS_shared_multisample,
|
||||
GLX_SGIX_dmbuffer,
|
||||
GLX_SGIX_fbconfig,
|
||||
GLX_SGIX_hyperpipe,
|
||||
GLX_SGIX_pbuffer,
|
||||
GLX_SGIX_swap_barrier,
|
||||
GLX_SGIX_swap_group,
|
||||
GLX_SGIX_video_resize,
|
||||
GLX_SGIX_video_source,
|
||||
GLX_SGIX_visual_select_group,
|
||||
GLX_SGI_cushion,
|
||||
GLX_SGI_make_current_read,
|
||||
GLX_SGI_swap_control,
|
||||
GLX_SGI_video_sync,
|
||||
GLX_SUN_get_transparent_index
|
||||
Loader: True
|
||||
Local files: False
|
||||
Omit khrplatform: False
|
||||
|
||||
Commandline:
|
||||
--api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index"
|
||||
Online:
|
||||
Too many extensions
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glad/glad_glx.h>
|
||||
|
||||
static void* get_proc(const char *namez);
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
static HMODULE libGL;
|
||||
|
||||
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
|
||||
static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
|
||||
|
||||
static
|
||||
int open_gl(void) {
|
||||
libGL = LoadLibraryW(L"opengl32.dll");
|
||||
if(libGL != NULL) {
|
||||
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress(
|
||||
libGL, "wglGetProcAddress");
|
||||
return gladGetProcAddressPtr != NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
void close_gl(void) {
|
||||
if(libGL != NULL) {
|
||||
FreeLibrary(libGL);
|
||||
libGL = NULL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
static void* libGL;
|
||||
|
||||
#ifndef __APPLE__
|
||||
typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
|
||||
static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
|
||||
#endif
|
||||
|
||||
static
|
||||
int open_gl(void) {
|
||||
#ifdef __APPLE__
|
||||
static const char *NAMES[] = {
|
||||
"../Frameworks/OpenGL.framework/OpenGL",
|
||||
"/Library/Frameworks/OpenGL.framework/OpenGL",
|
||||
"/System/Library/Frameworks/OpenGL.framework/OpenGL",
|
||||
"/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
|
||||
};
|
||||
#else
|
||||
static const char *NAMES[] = {"libGL.so.1", "libGL.so"};
|
||||
#endif
|
||||
|
||||
unsigned int index = 0;
|
||||
for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
|
||||
libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL);
|
||||
|
||||
if(libGL != NULL) {
|
||||
#ifdef __APPLE__
|
||||
return 1;
|
||||
#else
|
||||
gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL,
|
||||
"glXGetProcAddressARB");
|
||||
return gladGetProcAddressPtr != NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
void close_gl(void) {
|
||||
if(libGL != NULL) {
|
||||
dlclose(libGL);
|
||||
libGL = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static
|
||||
void* get_proc(const char *namez) {
|
||||
void* result = NULL;
|
||||
if(libGL == NULL) return NULL;
|
||||
|
||||
#ifndef __APPLE__
|
||||
if(gladGetProcAddressPtr != NULL) {
|
||||
result = gladGetProcAddressPtr(namez);
|
||||
}
|
||||
#endif
|
||||
if(result == NULL) {
|
||||
#ifdef _WIN32
|
||||
result = (void*)GetProcAddress(libGL, namez);
|
||||
#else
|
||||
result = dlsym(libGL, namez);
|
||||
#endif
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int gladLoadGLX(Display *dpy, int screen) {
|
||||
int status = 0;
|
||||
|
||||
if(open_gl()) {
|
||||
status = gladLoadGLXLoader((GLADloadproc)get_proc, dpy, screen);
|
||||
//close_gl();
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static Display *GLADGLXDisplay = 0;
|
||||
static int GLADGLXscreen = 0;
|
||||
|
||||
static int get_exts(void) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void free_exts(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
static int has_ext(const char *ext) {
|
||||
const char *terminator;
|
||||
const char *loc;
|
||||
const char *extensions;
|
||||
|
||||
if(!GLAD_GLX_VERSION_1_1)
|
||||
return 0;
|
||||
|
||||
extensions = glXQueryExtensionsString(GLADGLXDisplay, GLADGLXscreen);
|
||||
|
||||
if(extensions == NULL || ext == NULL)
|
||||
return 0;
|
||||
|
||||
while(1) {
|
||||
loc = strstr(extensions, ext);
|
||||
if(loc == NULL)
|
||||
break;
|
||||
|
||||
terminator = loc + strlen(ext);
|
||||
if((loc == extensions || *(loc - 1) == ' ') &&
|
||||
(*terminator == ' ' || *terminator == '\0'))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
extensions = terminator;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GLAD_GLX_VERSION_1_0;
|
||||
int GLAD_GLX_VERSION_1_1;
|
||||
int GLAD_GLX_VERSION_1_2;
|
||||
int GLAD_GLX_VERSION_1_3;
|
||||
int GLAD_GLX_VERSION_1_4;
|
||||
PFNGLXGETSELECTEDEVENTPROC glad_glXGetSelectedEvent;
|
||||
PFNGLXQUERYEXTENSIONPROC glad_glXQueryExtension;
|
||||
PFNGLXMAKECURRENTPROC glad_glXMakeCurrent;
|
||||
PFNGLXSELECTEVENTPROC glad_glXSelectEvent;
|
||||
PFNGLXCREATECONTEXTPROC glad_glXCreateContext;
|
||||
PFNGLXCREATEGLXPIXMAPPROC glad_glXCreateGLXPixmap;
|
||||
PFNGLXQUERYVERSIONPROC glad_glXQueryVersion;
|
||||
PFNGLXGETCURRENTREADDRAWABLEPROC glad_glXGetCurrentReadDrawable;
|
||||
PFNGLXDESTROYPIXMAPPROC glad_glXDestroyPixmap;
|
||||
PFNGLXGETCURRENTCONTEXTPROC glad_glXGetCurrentContext;
|
||||
PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress;
|
||||
PFNGLXWAITGLPROC glad_glXWaitGL;
|
||||
PFNGLXISDIRECTPROC glad_glXIsDirect;
|
||||
PFNGLXDESTROYWINDOWPROC glad_glXDestroyWindow;
|
||||
PFNGLXCREATEWINDOWPROC glad_glXCreateWindow;
|
||||
PFNGLXCOPYCONTEXTPROC glad_glXCopyContext;
|
||||
PFNGLXCREATEPBUFFERPROC glad_glXCreatePbuffer;
|
||||
PFNGLXSWAPBUFFERSPROC glad_glXSwapBuffers;
|
||||
PFNGLXGETCURRENTDISPLAYPROC glad_glXGetCurrentDisplay;
|
||||
PFNGLXGETCURRENTDRAWABLEPROC glad_glXGetCurrentDrawable;
|
||||
PFNGLXQUERYCONTEXTPROC glad_glXQueryContext;
|
||||
PFNGLXCHOOSEVISUALPROC glad_glXChooseVisual;
|
||||
PFNGLXQUERYSERVERSTRINGPROC glad_glXQueryServerString;
|
||||
PFNGLXDESTROYCONTEXTPROC glad_glXDestroyContext;
|
||||
PFNGLXDESTROYGLXPIXMAPPROC glad_glXDestroyGLXPixmap;
|
||||
PFNGLXGETFBCONFIGATTRIBPROC glad_glXGetFBConfigAttrib;
|
||||
PFNGLXUSEXFONTPROC glad_glXUseXFont;
|
||||
PFNGLXDESTROYPBUFFERPROC glad_glXDestroyPbuffer;
|
||||
PFNGLXCHOOSEFBCONFIGPROC glad_glXChooseFBConfig;
|
||||
PFNGLXCREATENEWCONTEXTPROC glad_glXCreateNewContext;
|
||||
PFNGLXMAKECONTEXTCURRENTPROC glad_glXMakeContextCurrent;
|
||||
PFNGLXGETCONFIGPROC glad_glXGetConfig;
|
||||
PFNGLXGETFBCONFIGSPROC glad_glXGetFBConfigs;
|
||||
PFNGLXCREATEPIXMAPPROC glad_glXCreatePixmap;
|
||||
PFNGLXWAITXPROC glad_glXWaitX;
|
||||
PFNGLXGETVISUALFROMFBCONFIGPROC glad_glXGetVisualFromFBConfig;
|
||||
PFNGLXQUERYDRAWABLEPROC glad_glXQueryDrawable;
|
||||
PFNGLXQUERYEXTENSIONSSTRINGPROC glad_glXQueryExtensionsString;
|
||||
PFNGLXGETCLIENTSTRINGPROC glad_glXGetClientString;
|
||||
int GLAD_GLX_ARB_framebuffer_sRGB;
|
||||
int GLAD_GLX_EXT_import_context;
|
||||
int GLAD_GLX_NV_float_buffer;
|
||||
int GLAD_GLX_EXT_libglvnd;
|
||||
int GLAD_GLX_SGIS_shared_multisample;
|
||||
int GLAD_GLX_SGIX_pbuffer;
|
||||
int GLAD_GLX_EXT_no_config_context;
|
||||
int GLAD_GLX_ARB_fbconfig_float;
|
||||
int GLAD_GLX_SGIX_hyperpipe;
|
||||
int GLAD_GLX_MESA_set_3dfx_mode;
|
||||
int GLAD_GLX_INTEL_swap_event;
|
||||
int GLAD_GLX_SGIX_video_resize;
|
||||
int GLAD_GLX_MESA_pixmap_colormap;
|
||||
int GLAD_GLX_EXT_create_context_es2_profile;
|
||||
int GLAD_GLX_ARB_robustness_application_isolation;
|
||||
int GLAD_GLX_NV_copy_image;
|
||||
int GLAD_GLX_NV_swap_group;
|
||||
int GLAD_GLX_OML_sync_control;
|
||||
int GLAD_GLX_EXT_framebuffer_sRGB;
|
||||
int GLAD_GLX_ARB_create_context_robustness;
|
||||
int GLAD_GLX_OML_swap_method;
|
||||
int GLAD_GLX_EXT_fbconfig_packed_float;
|
||||
int GLAD_GLX_EXT_buffer_age;
|
||||
int GLAD_GLX_3DFX_multisample;
|
||||
int GLAD_GLX_EXT_visual_info;
|
||||
int GLAD_GLX_SGI_video_sync;
|
||||
int GLAD_GLX_NV_video_capture;
|
||||
int GLAD_GLX_SGIS_multisample;
|
||||
int GLAD_GLX_EXT_texture_from_pixmap;
|
||||
int GLAD_GLX_NV_video_out;
|
||||
int GLAD_GLX_ARB_multisample;
|
||||
int GLAD_GLX_MESA_swap_control;
|
||||
int GLAD_GLX_NV_delay_before_swap;
|
||||
int GLAD_GLX_SGI_make_current_read;
|
||||
int GLAD_GLX_SGIX_swap_group;
|
||||
int GLAD_GLX_EXT_swap_control;
|
||||
int GLAD_GLX_SGIX_video_source;
|
||||
int GLAD_GLX_MESA_query_renderer;
|
||||
int GLAD_GLX_NV_robustness_video_memory_purge;
|
||||
int GLAD_GLX_ARB_create_context;
|
||||
int GLAD_GLX_ARB_context_flush_control;
|
||||
int GLAD_GLX_ARB_robustness_share_group_isolation;
|
||||
int GLAD_GLX_EXT_stereo_tree;
|
||||
int GLAD_GLX_SGI_swap_control;
|
||||
int GLAD_GLX_SGIX_dmbuffer;
|
||||
int GLAD_GLX_SGIX_visual_select_group;
|
||||
int GLAD_GLX_SGIS_blended_overlay;
|
||||
int GLAD_GLX_NV_multisample_coverage;
|
||||
int GLAD_GLX_EXT_create_context_es_profile;
|
||||
int GLAD_GLX_SGIX_fbconfig;
|
||||
int GLAD_GLX_EXT_swap_control_tear;
|
||||
int GLAD_GLX_SGI_cushion;
|
||||
int GLAD_GLX_MESA_release_buffers;
|
||||
int GLAD_GLX_EXT_visual_rating;
|
||||
int GLAD_GLX_MESA_copy_sub_buffer;
|
||||
int GLAD_GLX_MESA_agp_offset;
|
||||
int GLAD_GLX_NV_copy_buffer;
|
||||
int GLAD_GLX_ARB_create_context_no_error;
|
||||
int GLAD_GLX_NV_present_video;
|
||||
int GLAD_GLX_SUN_get_transparent_index;
|
||||
int GLAD_GLX_AMD_gpu_association;
|
||||
int GLAD_GLX_ARB_create_context_profile;
|
||||
int GLAD_GLX_SGIX_swap_barrier;
|
||||
int GLAD_GLX_ARB_get_proc_address;
|
||||
int GLAD_GLX_ARB_vertex_buffer_object;
|
||||
PFNGLXGETGPUIDSAMDPROC glad_glXGetGPUIDsAMD;
|
||||
PFNGLXGETGPUINFOAMDPROC glad_glXGetGPUInfoAMD;
|
||||
PFNGLXGETCONTEXTGPUIDAMDPROC glad_glXGetContextGPUIDAMD;
|
||||
PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC glad_glXCreateAssociatedContextAMD;
|
||||
PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC glad_glXCreateAssociatedContextAttribsAMD;
|
||||
PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC glad_glXDeleteAssociatedContextAMD;
|
||||
PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC glad_glXMakeAssociatedContextCurrentAMD;
|
||||
PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC glad_glXGetCurrentAssociatedContextAMD;
|
||||
PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC glad_glXBlitContextFramebufferAMD;
|
||||
PFNGLXCREATECONTEXTATTRIBSARBPROC glad_glXCreateContextAttribsARB;
|
||||
PFNGLXGETPROCADDRESSARBPROC glad_glXGetProcAddressARB;
|
||||
PFNGLXGETCURRENTDISPLAYEXTPROC glad_glXGetCurrentDisplayEXT;
|
||||
PFNGLXQUERYCONTEXTINFOEXTPROC glad_glXQueryContextInfoEXT;
|
||||
PFNGLXGETCONTEXTIDEXTPROC glad_glXGetContextIDEXT;
|
||||
PFNGLXIMPORTCONTEXTEXTPROC glad_glXImportContextEXT;
|
||||
PFNGLXFREECONTEXTEXTPROC glad_glXFreeContextEXT;
|
||||
PFNGLXSWAPINTERVALEXTPROC glad_glXSwapIntervalEXT;
|
||||
PFNGLXBINDTEXIMAGEEXTPROC glad_glXBindTexImageEXT;
|
||||
PFNGLXRELEASETEXIMAGEEXTPROC glad_glXReleaseTexImageEXT;
|
||||
PFNGLXGETAGPOFFSETMESAPROC glad_glXGetAGPOffsetMESA;
|
||||
PFNGLXCOPYSUBBUFFERMESAPROC glad_glXCopySubBufferMESA;
|
||||
PFNGLXCREATEGLXPIXMAPMESAPROC glad_glXCreateGLXPixmapMESA;
|
||||
PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glad_glXQueryCurrentRendererIntegerMESA;
|
||||
PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC glad_glXQueryCurrentRendererStringMESA;
|
||||
PFNGLXQUERYRENDERERINTEGERMESAPROC glad_glXQueryRendererIntegerMESA;
|
||||
PFNGLXQUERYRENDERERSTRINGMESAPROC glad_glXQueryRendererStringMESA;
|
||||
PFNGLXRELEASEBUFFERSMESAPROC glad_glXReleaseBuffersMESA;
|
||||
PFNGLXSET3DFXMODEMESAPROC glad_glXSet3DfxModeMESA;
|
||||
PFNGLXGETSWAPINTERVALMESAPROC glad_glXGetSwapIntervalMESA;
|
||||
PFNGLXSWAPINTERVALMESAPROC glad_glXSwapIntervalMESA;
|
||||
PFNGLXCOPYBUFFERSUBDATANVPROC glad_glXCopyBufferSubDataNV;
|
||||
PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC glad_glXNamedCopyBufferSubDataNV;
|
||||
PFNGLXCOPYIMAGESUBDATANVPROC glad_glXCopyImageSubDataNV;
|
||||
PFNGLXDELAYBEFORESWAPNVPROC glad_glXDelayBeforeSwapNV;
|
||||
PFNGLXENUMERATEVIDEODEVICESNVPROC glad_glXEnumerateVideoDevicesNV;
|
||||
PFNGLXBINDVIDEODEVICENVPROC glad_glXBindVideoDeviceNV;
|
||||
PFNGLXJOINSWAPGROUPNVPROC glad_glXJoinSwapGroupNV;
|
||||
PFNGLXBINDSWAPBARRIERNVPROC glad_glXBindSwapBarrierNV;
|
||||
PFNGLXQUERYSWAPGROUPNVPROC glad_glXQuerySwapGroupNV;
|
||||
PFNGLXQUERYMAXSWAPGROUPSNVPROC glad_glXQueryMaxSwapGroupsNV;
|
||||
PFNGLXQUERYFRAMECOUNTNVPROC glad_glXQueryFrameCountNV;
|
||||
PFNGLXRESETFRAMECOUNTNVPROC glad_glXResetFrameCountNV;
|
||||
PFNGLXBINDVIDEOCAPTUREDEVICENVPROC glad_glXBindVideoCaptureDeviceNV;
|
||||
PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC glad_glXEnumerateVideoCaptureDevicesNV;
|
||||
PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC glad_glXLockVideoCaptureDeviceNV;
|
||||
PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC glad_glXQueryVideoCaptureDeviceNV;
|
||||
PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC glad_glXReleaseVideoCaptureDeviceNV;
|
||||
PFNGLXGETVIDEODEVICENVPROC glad_glXGetVideoDeviceNV;
|
||||
PFNGLXRELEASEVIDEODEVICENVPROC glad_glXReleaseVideoDeviceNV;
|
||||
PFNGLXBINDVIDEOIMAGENVPROC glad_glXBindVideoImageNV;
|
||||
PFNGLXRELEASEVIDEOIMAGENVPROC glad_glXReleaseVideoImageNV;
|
||||
PFNGLXSENDPBUFFERTOVIDEONVPROC glad_glXSendPbufferToVideoNV;
|
||||
PFNGLXGETVIDEOINFONVPROC glad_glXGetVideoInfoNV;
|
||||
PFNGLXGETSYNCVALUESOMLPROC glad_glXGetSyncValuesOML;
|
||||
PFNGLXGETMSCRATEOMLPROC glad_glXGetMscRateOML;
|
||||
PFNGLXSWAPBUFFERSMSCOMLPROC glad_glXSwapBuffersMscOML;
|
||||
PFNGLXWAITFORMSCOMLPROC glad_glXWaitForMscOML;
|
||||
PFNGLXWAITFORSBCOMLPROC glad_glXWaitForSbcOML;
|
||||
#ifdef _DM_BUFFER_H_
|
||||
PFNGLXASSOCIATEDMPBUFFERSGIXPROC glad_glXAssociateDMPbufferSGIX;
|
||||
#endif
|
||||
PFNGLXGETFBCONFIGATTRIBSGIXPROC glad_glXGetFBConfigAttribSGIX;
|
||||
PFNGLXCHOOSEFBCONFIGSGIXPROC glad_glXChooseFBConfigSGIX;
|
||||
PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC glad_glXCreateGLXPixmapWithConfigSGIX;
|
||||
PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC glad_glXCreateContextWithConfigSGIX;
|
||||
PFNGLXGETVISUALFROMFBCONFIGSGIXPROC glad_glXGetVisualFromFBConfigSGIX;
|
||||
PFNGLXGETFBCONFIGFROMVISUALSGIXPROC glad_glXGetFBConfigFromVisualSGIX;
|
||||
PFNGLXQUERYHYPERPIPENETWORKSGIXPROC glad_glXQueryHyperpipeNetworkSGIX;
|
||||
PFNGLXHYPERPIPECONFIGSGIXPROC glad_glXHyperpipeConfigSGIX;
|
||||
PFNGLXQUERYHYPERPIPECONFIGSGIXPROC glad_glXQueryHyperpipeConfigSGIX;
|
||||
PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC glad_glXDestroyHyperpipeConfigSGIX;
|
||||
PFNGLXBINDHYPERPIPESGIXPROC glad_glXBindHyperpipeSGIX;
|
||||
PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC glad_glXQueryHyperpipeBestAttribSGIX;
|
||||
PFNGLXHYPERPIPEATTRIBSGIXPROC glad_glXHyperpipeAttribSGIX;
|
||||
PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC glad_glXQueryHyperpipeAttribSGIX;
|
||||
PFNGLXCREATEGLXPBUFFERSGIXPROC glad_glXCreateGLXPbufferSGIX;
|
||||
PFNGLXDESTROYGLXPBUFFERSGIXPROC glad_glXDestroyGLXPbufferSGIX;
|
||||
PFNGLXQUERYGLXPBUFFERSGIXPROC glad_glXQueryGLXPbufferSGIX;
|
||||
PFNGLXSELECTEVENTSGIXPROC glad_glXSelectEventSGIX;
|
||||
PFNGLXGETSELECTEDEVENTSGIXPROC glad_glXGetSelectedEventSGIX;
|
||||
PFNGLXBINDSWAPBARRIERSGIXPROC glad_glXBindSwapBarrierSGIX;
|
||||
PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC glad_glXQueryMaxSwapBarriersSGIX;
|
||||
PFNGLXJOINSWAPGROUPSGIXPROC glad_glXJoinSwapGroupSGIX;
|
||||
PFNGLXBINDCHANNELTOWINDOWSGIXPROC glad_glXBindChannelToWindowSGIX;
|
||||
PFNGLXCHANNELRECTSGIXPROC glad_glXChannelRectSGIX;
|
||||
PFNGLXQUERYCHANNELRECTSGIXPROC glad_glXQueryChannelRectSGIX;
|
||||
PFNGLXQUERYCHANNELDELTASSGIXPROC glad_glXQueryChannelDeltasSGIX;
|
||||
PFNGLXCHANNELRECTSYNCSGIXPROC glad_glXChannelRectSyncSGIX;
|
||||
#ifdef _VL_H_
|
||||
PFNGLXCREATEGLXVIDEOSOURCESGIXPROC glad_glXCreateGLXVideoSourceSGIX;
|
||||
PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC glad_glXDestroyGLXVideoSourceSGIX;
|
||||
#endif
|
||||
PFNGLXCUSHIONSGIPROC glad_glXCushionSGI;
|
||||
PFNGLXMAKECURRENTREADSGIPROC glad_glXMakeCurrentReadSGI;
|
||||
PFNGLXGETCURRENTREADDRAWABLESGIPROC glad_glXGetCurrentReadDrawableSGI;
|
||||
PFNGLXSWAPINTERVALSGIPROC glad_glXSwapIntervalSGI;
|
||||
PFNGLXGETVIDEOSYNCSGIPROC glad_glXGetVideoSyncSGI;
|
||||
PFNGLXWAITVIDEOSYNCSGIPROC glad_glXWaitVideoSyncSGI;
|
||||
PFNGLXGETTRANSPARENTINDEXSUNPROC glad_glXGetTransparentIndexSUN;
|
||||
static void load_GLX_VERSION_1_0(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_0) return;
|
||||
glad_glXChooseVisual = (PFNGLXCHOOSEVISUALPROC)load("glXChooseVisual");
|
||||
glad_glXCreateContext = (PFNGLXCREATECONTEXTPROC)load("glXCreateContext");
|
||||
glad_glXDestroyContext = (PFNGLXDESTROYCONTEXTPROC)load("glXDestroyContext");
|
||||
glad_glXMakeCurrent = (PFNGLXMAKECURRENTPROC)load("glXMakeCurrent");
|
||||
glad_glXCopyContext = (PFNGLXCOPYCONTEXTPROC)load("glXCopyContext");
|
||||
glad_glXSwapBuffers = (PFNGLXSWAPBUFFERSPROC)load("glXSwapBuffers");
|
||||
glad_glXCreateGLXPixmap = (PFNGLXCREATEGLXPIXMAPPROC)load("glXCreateGLXPixmap");
|
||||
glad_glXDestroyGLXPixmap = (PFNGLXDESTROYGLXPIXMAPPROC)load("glXDestroyGLXPixmap");
|
||||
glad_glXQueryExtension = (PFNGLXQUERYEXTENSIONPROC)load("glXQueryExtension");
|
||||
glad_glXQueryVersion = (PFNGLXQUERYVERSIONPROC)load("glXQueryVersion");
|
||||
glad_glXIsDirect = (PFNGLXISDIRECTPROC)load("glXIsDirect");
|
||||
glad_glXGetConfig = (PFNGLXGETCONFIGPROC)load("glXGetConfig");
|
||||
glad_glXGetCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC)load("glXGetCurrentContext");
|
||||
glad_glXGetCurrentDrawable = (PFNGLXGETCURRENTDRAWABLEPROC)load("glXGetCurrentDrawable");
|
||||
glad_glXWaitGL = (PFNGLXWAITGLPROC)load("glXWaitGL");
|
||||
glad_glXWaitX = (PFNGLXWAITXPROC)load("glXWaitX");
|
||||
glad_glXUseXFont = (PFNGLXUSEXFONTPROC)load("glXUseXFont");
|
||||
}
|
||||
static void load_GLX_VERSION_1_1(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_1) return;
|
||||
glad_glXQueryExtensionsString = (PFNGLXQUERYEXTENSIONSSTRINGPROC)load("glXQueryExtensionsString");
|
||||
glad_glXQueryServerString = (PFNGLXQUERYSERVERSTRINGPROC)load("glXQueryServerString");
|
||||
glad_glXGetClientString = (PFNGLXGETCLIENTSTRINGPROC)load("glXGetClientString");
|
||||
}
|
||||
static void load_GLX_VERSION_1_2(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_2) return;
|
||||
glad_glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)load("glXGetCurrentDisplay");
|
||||
}
|
||||
static void load_GLX_VERSION_1_3(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_3) return;
|
||||
glad_glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)load("glXGetFBConfigs");
|
||||
glad_glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)load("glXChooseFBConfig");
|
||||
glad_glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)load("glXGetFBConfigAttrib");
|
||||
glad_glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)load("glXGetVisualFromFBConfig");
|
||||
glad_glXCreateWindow = (PFNGLXCREATEWINDOWPROC)load("glXCreateWindow");
|
||||
glad_glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)load("glXDestroyWindow");
|
||||
glad_glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)load("glXCreatePixmap");
|
||||
glad_glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)load("glXDestroyPixmap");
|
||||
glad_glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)load("glXCreatePbuffer");
|
||||
glad_glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)load("glXDestroyPbuffer");
|
||||
glad_glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)load("glXQueryDrawable");
|
||||
glad_glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)load("glXCreateNewContext");
|
||||
glad_glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)load("glXMakeContextCurrent");
|
||||
glad_glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)load("glXGetCurrentReadDrawable");
|
||||
glad_glXQueryContext = (PFNGLXQUERYCONTEXTPROC)load("glXQueryContext");
|
||||
glad_glXSelectEvent = (PFNGLXSELECTEVENTPROC)load("glXSelectEvent");
|
||||
glad_glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)load("glXGetSelectedEvent");
|
||||
}
|
||||
static void load_GLX_VERSION_1_4(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_4) return;
|
||||
glad_glXGetProcAddress = (PFNGLXGETPROCADDRESSPROC)load("glXGetProcAddress");
|
||||
}
|
||||
static void load_GLX_AMD_gpu_association(GLADloadproc load) {
|
||||
if(!GLAD_GLX_AMD_gpu_association) return;
|
||||
glad_glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)load("glXGetGPUIDsAMD");
|
||||
glad_glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)load("glXGetGPUInfoAMD");
|
||||
glad_glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)load("glXGetContextGPUIDAMD");
|
||||
glad_glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)load("glXCreateAssociatedContextAMD");
|
||||
glad_glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)load("glXCreateAssociatedContextAttribsAMD");
|
||||
glad_glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)load("glXDeleteAssociatedContextAMD");
|
||||
glad_glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)load("glXMakeAssociatedContextCurrentAMD");
|
||||
glad_glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)load("glXGetCurrentAssociatedContextAMD");
|
||||
glad_glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)load("glXBlitContextFramebufferAMD");
|
||||
}
|
||||
static void load_GLX_ARB_create_context(GLADloadproc load) {
|
||||
if(!GLAD_GLX_ARB_create_context) return;
|
||||
glad_glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)load("glXCreateContextAttribsARB");
|
||||
}
|
||||
static void load_GLX_ARB_get_proc_address(GLADloadproc load) {
|
||||
if(!GLAD_GLX_ARB_get_proc_address) return;
|
||||
glad_glXGetProcAddressARB = (PFNGLXGETPROCADDRESSARBPROC)load("glXGetProcAddressARB");
|
||||
}
|
||||
static void load_GLX_EXT_import_context(GLADloadproc load) {
|
||||
if(!GLAD_GLX_EXT_import_context) return;
|
||||
glad_glXGetCurrentDisplayEXT = (PFNGLXGETCURRENTDISPLAYEXTPROC)load("glXGetCurrentDisplayEXT");
|
||||
glad_glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)load("glXQueryContextInfoEXT");
|
||||
glad_glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)load("glXGetContextIDEXT");
|
||||
glad_glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)load("glXImportContextEXT");
|
||||
glad_glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)load("glXFreeContextEXT");
|
||||
}
|
||||
static void load_GLX_EXT_swap_control(GLADloadproc load) {
|
||||
if(!GLAD_GLX_EXT_swap_control) return;
|
||||
glad_glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)load("glXSwapIntervalEXT");
|
||||
}
|
||||
static void load_GLX_EXT_texture_from_pixmap(GLADloadproc load) {
|
||||
if(!GLAD_GLX_EXT_texture_from_pixmap) return;
|
||||
glad_glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)load("glXBindTexImageEXT");
|
||||
glad_glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)load("glXReleaseTexImageEXT");
|
||||
}
|
||||
static void load_GLX_MESA_agp_offset(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_agp_offset) return;
|
||||
glad_glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)load("glXGetAGPOffsetMESA");
|
||||
}
|
||||
static void load_GLX_MESA_copy_sub_buffer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_copy_sub_buffer) return;
|
||||
glad_glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)load("glXCopySubBufferMESA");
|
||||
}
|
||||
static void load_GLX_MESA_pixmap_colormap(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_pixmap_colormap) return;
|
||||
glad_glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)load("glXCreateGLXPixmapMESA");
|
||||
}
|
||||
static void load_GLX_MESA_query_renderer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_query_renderer) return;
|
||||
glad_glXQueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)load("glXQueryCurrentRendererIntegerMESA");
|
||||
glad_glXQueryCurrentRendererStringMESA = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)load("glXQueryCurrentRendererStringMESA");
|
||||
glad_glXQueryRendererIntegerMESA = (PFNGLXQUERYRENDERERINTEGERMESAPROC)load("glXQueryRendererIntegerMESA");
|
||||
glad_glXQueryRendererStringMESA = (PFNGLXQUERYRENDERERSTRINGMESAPROC)load("glXQueryRendererStringMESA");
|
||||
}
|
||||
static void load_GLX_MESA_release_buffers(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_release_buffers) return;
|
||||
glad_glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)load("glXReleaseBuffersMESA");
|
||||
}
|
||||
static void load_GLX_MESA_set_3dfx_mode(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_set_3dfx_mode) return;
|
||||
glad_glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)load("glXSet3DfxModeMESA");
|
||||
}
|
||||
static void load_GLX_MESA_swap_control(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_swap_control) return;
|
||||
glad_glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)load("glXGetSwapIntervalMESA");
|
||||
glad_glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)load("glXSwapIntervalMESA");
|
||||
}
|
||||
static void load_GLX_NV_copy_buffer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_copy_buffer) return;
|
||||
glad_glXCopyBufferSubDataNV = (PFNGLXCOPYBUFFERSUBDATANVPROC)load("glXCopyBufferSubDataNV");
|
||||
glad_glXNamedCopyBufferSubDataNV = (PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC)load("glXNamedCopyBufferSubDataNV");
|
||||
}
|
||||
static void load_GLX_NV_copy_image(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_copy_image) return;
|
||||
glad_glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)load("glXCopyImageSubDataNV");
|
||||
}
|
||||
static void load_GLX_NV_delay_before_swap(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_delay_before_swap) return;
|
||||
glad_glXDelayBeforeSwapNV = (PFNGLXDELAYBEFORESWAPNVPROC)load("glXDelayBeforeSwapNV");
|
||||
}
|
||||
static void load_GLX_NV_present_video(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_present_video) return;
|
||||
glad_glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)load("glXEnumerateVideoDevicesNV");
|
||||
glad_glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)load("glXBindVideoDeviceNV");
|
||||
}
|
||||
static void load_GLX_NV_swap_group(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_swap_group) return;
|
||||
glad_glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)load("glXJoinSwapGroupNV");
|
||||
glad_glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)load("glXBindSwapBarrierNV");
|
||||
glad_glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)load("glXQuerySwapGroupNV");
|
||||
glad_glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)load("glXQueryMaxSwapGroupsNV");
|
||||
glad_glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)load("glXQueryFrameCountNV");
|
||||
glad_glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)load("glXResetFrameCountNV");
|
||||
}
|
||||
static void load_GLX_NV_video_capture(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_video_capture) return;
|
||||
glad_glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)load("glXBindVideoCaptureDeviceNV");
|
||||
glad_glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)load("glXEnumerateVideoCaptureDevicesNV");
|
||||
glad_glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)load("glXLockVideoCaptureDeviceNV");
|
||||
glad_glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)load("glXQueryVideoCaptureDeviceNV");
|
||||
glad_glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)load("glXReleaseVideoCaptureDeviceNV");
|
||||
}
|
||||
static void load_GLX_NV_video_out(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_video_out) return;
|
||||
glad_glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)load("glXGetVideoDeviceNV");
|
||||
glad_glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)load("glXReleaseVideoDeviceNV");
|
||||
glad_glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)load("glXBindVideoImageNV");
|
||||
glad_glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)load("glXReleaseVideoImageNV");
|
||||
glad_glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)load("glXSendPbufferToVideoNV");
|
||||
glad_glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)load("glXGetVideoInfoNV");
|
||||
}
|
||||
static void load_GLX_OML_sync_control(GLADloadproc load) {
|
||||
if(!GLAD_GLX_OML_sync_control) return;
|
||||
glad_glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)load("glXGetSyncValuesOML");
|
||||
glad_glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)load("glXGetMscRateOML");
|
||||
glad_glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)load("glXSwapBuffersMscOML");
|
||||
glad_glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)load("glXWaitForMscOML");
|
||||
glad_glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)load("glXWaitForSbcOML");
|
||||
}
|
||||
static void load_GLX_SGIX_dmbuffer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_dmbuffer) return;
|
||||
#ifdef _DM_BUFFER_H_
|
||||
glad_glXAssociateDMPbufferSGIX = (PFNGLXASSOCIATEDMPBUFFERSGIXPROC)load("glXAssociateDMPbufferSGIX");
|
||||
#else
|
||||
(void)load;
|
||||
#endif
|
||||
}
|
||||
static void load_GLX_SGIX_fbconfig(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_fbconfig) return;
|
||||
glad_glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)load("glXGetFBConfigAttribSGIX");
|
||||
glad_glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)load("glXChooseFBConfigSGIX");
|
||||
glad_glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)load("glXCreateGLXPixmapWithConfigSGIX");
|
||||
glad_glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)load("glXCreateContextWithConfigSGIX");
|
||||
glad_glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)load("glXGetVisualFromFBConfigSGIX");
|
||||
glad_glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)load("glXGetFBConfigFromVisualSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_hyperpipe(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_hyperpipe) return;
|
||||
glad_glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)load("glXQueryHyperpipeNetworkSGIX");
|
||||
glad_glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)load("glXHyperpipeConfigSGIX");
|
||||
glad_glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)load("glXQueryHyperpipeConfigSGIX");
|
||||
glad_glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)load("glXDestroyHyperpipeConfigSGIX");
|
||||
glad_glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)load("glXBindHyperpipeSGIX");
|
||||
glad_glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)load("glXQueryHyperpipeBestAttribSGIX");
|
||||
glad_glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)load("glXHyperpipeAttribSGIX");
|
||||
glad_glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)load("glXQueryHyperpipeAttribSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_pbuffer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_pbuffer) return;
|
||||
glad_glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)load("glXCreateGLXPbufferSGIX");
|
||||
glad_glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)load("glXDestroyGLXPbufferSGIX");
|
||||
glad_glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)load("glXQueryGLXPbufferSGIX");
|
||||
glad_glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)load("glXSelectEventSGIX");
|
||||
glad_glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)load("glXGetSelectedEventSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_swap_barrier(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_swap_barrier) return;
|
||||
glad_glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)load("glXBindSwapBarrierSGIX");
|
||||
glad_glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)load("glXQueryMaxSwapBarriersSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_swap_group(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_swap_group) return;
|
||||
glad_glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)load("glXJoinSwapGroupSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_video_resize(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_video_resize) return;
|
||||
glad_glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)load("glXBindChannelToWindowSGIX");
|
||||
glad_glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)load("glXChannelRectSGIX");
|
||||
glad_glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)load("glXQueryChannelRectSGIX");
|
||||
glad_glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)load("glXQueryChannelDeltasSGIX");
|
||||
glad_glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)load("glXChannelRectSyncSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_video_source(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_video_source) return;
|
||||
#ifdef _VL_H_
|
||||
glad_glXCreateGLXVideoSourceSGIX = (PFNGLXCREATEGLXVIDEOSOURCESGIXPROC)load("glXCreateGLXVideoSourceSGIX");
|
||||
glad_glXDestroyGLXVideoSourceSGIX = (PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC)load("glXDestroyGLXVideoSourceSGIX");
|
||||
#else
|
||||
(void)load;
|
||||
#endif
|
||||
}
|
||||
static void load_GLX_SGI_cushion(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGI_cushion) return;
|
||||
glad_glXCushionSGI = (PFNGLXCUSHIONSGIPROC)load("glXCushionSGI");
|
||||
}
|
||||
static void load_GLX_SGI_make_current_read(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGI_make_current_read) return;
|
||||
glad_glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)load("glXMakeCurrentReadSGI");
|
||||
glad_glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)load("glXGetCurrentReadDrawableSGI");
|
||||
}
|
||||
static void load_GLX_SGI_swap_control(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGI_swap_control) return;
|
||||
glad_glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)load("glXSwapIntervalSGI");
|
||||
}
|
||||
static void load_GLX_SGI_video_sync(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGI_video_sync) return;
|
||||
glad_glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)load("glXGetVideoSyncSGI");
|
||||
glad_glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)load("glXWaitVideoSyncSGI");
|
||||
}
|
||||
static void load_GLX_SUN_get_transparent_index(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SUN_get_transparent_index) return;
|
||||
glad_glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)load("glXGetTransparentIndexSUN");
|
||||
}
|
||||
static int find_extensionsGLX(void) {
|
||||
if (!get_exts()) return 0;
|
||||
GLAD_GLX_3DFX_multisample = has_ext("GLX_3DFX_multisample");
|
||||
GLAD_GLX_AMD_gpu_association = has_ext("GLX_AMD_gpu_association");
|
||||
GLAD_GLX_ARB_context_flush_control = has_ext("GLX_ARB_context_flush_control");
|
||||
GLAD_GLX_ARB_create_context = has_ext("GLX_ARB_create_context");
|
||||
GLAD_GLX_ARB_create_context_no_error = has_ext("GLX_ARB_create_context_no_error");
|
||||
GLAD_GLX_ARB_create_context_profile = has_ext("GLX_ARB_create_context_profile");
|
||||
GLAD_GLX_ARB_create_context_robustness = has_ext("GLX_ARB_create_context_robustness");
|
||||
GLAD_GLX_ARB_fbconfig_float = has_ext("GLX_ARB_fbconfig_float");
|
||||
GLAD_GLX_ARB_framebuffer_sRGB = has_ext("GLX_ARB_framebuffer_sRGB");
|
||||
GLAD_GLX_ARB_get_proc_address = has_ext("GLX_ARB_get_proc_address");
|
||||
GLAD_GLX_ARB_multisample = has_ext("GLX_ARB_multisample");
|
||||
GLAD_GLX_ARB_robustness_application_isolation = has_ext("GLX_ARB_robustness_application_isolation");
|
||||
GLAD_GLX_ARB_robustness_share_group_isolation = has_ext("GLX_ARB_robustness_share_group_isolation");
|
||||
GLAD_GLX_ARB_vertex_buffer_object = has_ext("GLX_ARB_vertex_buffer_object");
|
||||
GLAD_GLX_EXT_buffer_age = has_ext("GLX_EXT_buffer_age");
|
||||
GLAD_GLX_EXT_create_context_es2_profile = has_ext("GLX_EXT_create_context_es2_profile");
|
||||
GLAD_GLX_EXT_create_context_es_profile = has_ext("GLX_EXT_create_context_es_profile");
|
||||
GLAD_GLX_EXT_fbconfig_packed_float = has_ext("GLX_EXT_fbconfig_packed_float");
|
||||
GLAD_GLX_EXT_framebuffer_sRGB = has_ext("GLX_EXT_framebuffer_sRGB");
|
||||
GLAD_GLX_EXT_import_context = has_ext("GLX_EXT_import_context");
|
||||
GLAD_GLX_EXT_libglvnd = has_ext("GLX_EXT_libglvnd");
|
||||
GLAD_GLX_EXT_no_config_context = has_ext("GLX_EXT_no_config_context");
|
||||
GLAD_GLX_EXT_stereo_tree = has_ext("GLX_EXT_stereo_tree");
|
||||
GLAD_GLX_EXT_swap_control = has_ext("GLX_EXT_swap_control");
|
||||
GLAD_GLX_EXT_swap_control_tear = has_ext("GLX_EXT_swap_control_tear");
|
||||
GLAD_GLX_EXT_texture_from_pixmap = has_ext("GLX_EXT_texture_from_pixmap");
|
||||
GLAD_GLX_EXT_visual_info = has_ext("GLX_EXT_visual_info");
|
||||
GLAD_GLX_EXT_visual_rating = has_ext("GLX_EXT_visual_rating");
|
||||
GLAD_GLX_INTEL_swap_event = has_ext("GLX_INTEL_swap_event");
|
||||
GLAD_GLX_MESA_agp_offset = has_ext("GLX_MESA_agp_offset");
|
||||
GLAD_GLX_MESA_copy_sub_buffer = has_ext("GLX_MESA_copy_sub_buffer");
|
||||
GLAD_GLX_MESA_pixmap_colormap = has_ext("GLX_MESA_pixmap_colormap");
|
||||
GLAD_GLX_MESA_query_renderer = has_ext("GLX_MESA_query_renderer");
|
||||
GLAD_GLX_MESA_release_buffers = has_ext("GLX_MESA_release_buffers");
|
||||
GLAD_GLX_MESA_set_3dfx_mode = has_ext("GLX_MESA_set_3dfx_mode");
|
||||
GLAD_GLX_MESA_swap_control = has_ext("GLX_MESA_swap_control");
|
||||
GLAD_GLX_NV_copy_buffer = has_ext("GLX_NV_copy_buffer");
|
||||
GLAD_GLX_NV_copy_image = has_ext("GLX_NV_copy_image");
|
||||
GLAD_GLX_NV_delay_before_swap = has_ext("GLX_NV_delay_before_swap");
|
||||
GLAD_GLX_NV_float_buffer = has_ext("GLX_NV_float_buffer");
|
||||
GLAD_GLX_NV_multisample_coverage = has_ext("GLX_NV_multisample_coverage");
|
||||
GLAD_GLX_NV_present_video = has_ext("GLX_NV_present_video");
|
||||
GLAD_GLX_NV_robustness_video_memory_purge = has_ext("GLX_NV_robustness_video_memory_purge");
|
||||
GLAD_GLX_NV_swap_group = has_ext("GLX_NV_swap_group");
|
||||
GLAD_GLX_NV_video_capture = has_ext("GLX_NV_video_capture");
|
||||
GLAD_GLX_NV_video_out = has_ext("GLX_NV_video_out");
|
||||
GLAD_GLX_OML_swap_method = has_ext("GLX_OML_swap_method");
|
||||
GLAD_GLX_OML_sync_control = has_ext("GLX_OML_sync_control");
|
||||
GLAD_GLX_SGIS_blended_overlay = has_ext("GLX_SGIS_blended_overlay");
|
||||
GLAD_GLX_SGIS_multisample = has_ext("GLX_SGIS_multisample");
|
||||
GLAD_GLX_SGIS_shared_multisample = has_ext("GLX_SGIS_shared_multisample");
|
||||
GLAD_GLX_SGIX_dmbuffer = has_ext("GLX_SGIX_dmbuffer");
|
||||
GLAD_GLX_SGIX_fbconfig = has_ext("GLX_SGIX_fbconfig");
|
||||
GLAD_GLX_SGIX_hyperpipe = has_ext("GLX_SGIX_hyperpipe");
|
||||
GLAD_GLX_SGIX_pbuffer = has_ext("GLX_SGIX_pbuffer");
|
||||
GLAD_GLX_SGIX_swap_barrier = has_ext("GLX_SGIX_swap_barrier");
|
||||
GLAD_GLX_SGIX_swap_group = has_ext("GLX_SGIX_swap_group");
|
||||
GLAD_GLX_SGIX_video_resize = has_ext("GLX_SGIX_video_resize");
|
||||
GLAD_GLX_SGIX_video_source = has_ext("GLX_SGIX_video_source");
|
||||
GLAD_GLX_SGIX_visual_select_group = has_ext("GLX_SGIX_visual_select_group");
|
||||
GLAD_GLX_SGI_cushion = has_ext("GLX_SGI_cushion");
|
||||
GLAD_GLX_SGI_make_current_read = has_ext("GLX_SGI_make_current_read");
|
||||
GLAD_GLX_SGI_swap_control = has_ext("GLX_SGI_swap_control");
|
||||
GLAD_GLX_SGI_video_sync = has_ext("GLX_SGI_video_sync");
|
||||
GLAD_GLX_SUN_get_transparent_index = has_ext("GLX_SUN_get_transparent_index");
|
||||
free_exts();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void find_coreGLX(Display *dpy, int screen) {
|
||||
int major = 0, minor = 0;
|
||||
glXQueryVersion(dpy, &major, &minor);
|
||||
GLADGLXDisplay = dpy;
|
||||
GLADGLXscreen = screen;
|
||||
GLAD_GLX_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
|
||||
GLAD_GLX_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
|
||||
GLAD_GLX_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
|
||||
GLAD_GLX_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
|
||||
GLAD_GLX_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
|
||||
}
|
||||
|
||||
int gladLoadGLXLoader(GLADloadproc load, Display *dpy, int screen) {
|
||||
glXQueryVersion = (PFNGLXQUERYVERSIONPROC)load("glXQueryVersion");
|
||||
if(glXQueryVersion == NULL) return 0;
|
||||
find_coreGLX(dpy, screen);
|
||||
load_GLX_VERSION_1_0(load);
|
||||
load_GLX_VERSION_1_1(load);
|
||||
load_GLX_VERSION_1_2(load);
|
||||
load_GLX_VERSION_1_3(load);
|
||||
load_GLX_VERSION_1_4(load);
|
||||
|
||||
if (!find_extensionsGLX()) return 0;
|
||||
load_GLX_AMD_gpu_association(load);
|
||||
load_GLX_ARB_create_context(load);
|
||||
load_GLX_ARB_get_proc_address(load);
|
||||
load_GLX_EXT_import_context(load);
|
||||
load_GLX_EXT_swap_control(load);
|
||||
load_GLX_EXT_texture_from_pixmap(load);
|
||||
load_GLX_MESA_agp_offset(load);
|
||||
load_GLX_MESA_copy_sub_buffer(load);
|
||||
load_GLX_MESA_pixmap_colormap(load);
|
||||
load_GLX_MESA_query_renderer(load);
|
||||
load_GLX_MESA_release_buffers(load);
|
||||
load_GLX_MESA_set_3dfx_mode(load);
|
||||
load_GLX_MESA_swap_control(load);
|
||||
load_GLX_NV_copy_buffer(load);
|
||||
load_GLX_NV_copy_image(load);
|
||||
load_GLX_NV_delay_before_swap(load);
|
||||
load_GLX_NV_present_video(load);
|
||||
load_GLX_NV_swap_group(load);
|
||||
load_GLX_NV_video_capture(load);
|
||||
load_GLX_NV_video_out(load);
|
||||
load_GLX_OML_sync_control(load);
|
||||
load_GLX_SGIX_dmbuffer(load);
|
||||
load_GLX_SGIX_fbconfig(load);
|
||||
load_GLX_SGIX_hyperpipe(load);
|
||||
load_GLX_SGIX_pbuffer(load);
|
||||
load_GLX_SGIX_swap_barrier(load);
|
||||
load_GLX_SGIX_swap_group(load);
|
||||
load_GLX_SGIX_video_resize(load);
|
||||
load_GLX_SGIX_video_source(load);
|
||||
load_GLX_SGI_cushion(load);
|
||||
load_GLX_SGI_make_current_read(load);
|
||||
load_GLX_SGI_swap_control(load);
|
||||
load_GLX_SGI_video_sync(load);
|
||||
load_GLX_SUN_get_transparent_index(load);
|
||||
return 1;
|
||||
}
|
||||
|
858
examples/ThirdPartyLibs/glad/glx.c
Normal file
858
examples/ThirdPartyLibs/glad/glx.c
Normal file
@ -0,0 +1,858 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glad/glx.h>
|
||||
#ifdef DYNAMIC_LOAD_X11_FUNCTIONS
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
typedef Display* (* PFNXOPENDISPLAY) (_Xconst char* a);
|
||||
typedef Screen* (* PFNXDEFAULTSCREENOFDISPLAY) (Display*);
|
||||
typedef int (* PFNXSCREENNUMBEROFSCREEN) (Screen*);
|
||||
typedef struct
|
||||
{
|
||||
void* library;
|
||||
PFNXOPENDISPLAY XOpenDisplay;
|
||||
PFNXDEFAULTSCREENOFDISPLAY XDefaultScreenOfDisplay;
|
||||
PFNXSCREENNUMBEROFSCREEN XScreenNumberOfScreen;
|
||||
} X11Struct;
|
||||
#ifdef DYNAMIC_LOAD_X11_FUNCTIONS
|
||||
void initX11Struct(X11Struct *x11) {
|
||||
const char *X11_LIBRARY = "libX11.so.6";
|
||||
x11->library = dlopen(X11_LIBRARY, RTLD_LOCAL | RTLD_NOW);
|
||||
if (!x11->library) { fprintf(stderr, "Error opening X11 library %s\n", X11_LIBRARY); exit(EXIT_FAILURE); }
|
||||
int missingFunc = 0;
|
||||
missingFunc = ((x11->XOpenDisplay = (PFNXOPENDISPLAY) dlsym(x11->library,"XOpenDisplay"))==NULL) | missingFunc;
|
||||
if (missingFunc) { fprintf(stderr, "Error: missing func XOpenDisplay in %s, exiting!\n", X11_LIBRARY); exit(EXIT_FAILURE);}
|
||||
missingFunc = ((x11->XDefaultScreenOfDisplay = (PFNXDEFAULTSCREENOFDISPLAY) dlsym(x11->library,"XDefaultScreenOfDisplay"))==NULL) | missingFunc;
|
||||
if (missingFunc) { fprintf(stderr, "Error: missing func XScreenNumberOfScreen in %s, exiting!\n", X11_LIBRARY); exit(EXIT_FAILURE);}
|
||||
missingFunc = ((x11->XScreenNumberOfScreen = (PFNXSCREENNUMBEROFSCREEN) dlsym(x11->library,"XScreenNumberOfScreen"))==NULL) | missingFunc;
|
||||
if (missingFunc) { fprintf(stderr, "Error: missing func XScreenNumberOfScreen in %s, exiting!\n", X11_LIBRARY); exit(EXIT_FAILURE);}
|
||||
if (!missingFunc) { printf("X11 functions dynamically loaded using dlopen/dlsym OK!\n");}
|
||||
}
|
||||
#else
|
||||
void initX11Struct(X11Struct *x11) {
|
||||
x11->XOpenDisplay = XOpenDisplay;
|
||||
x11->XDefaultScreenOfDisplay = XDefaultScreenOfDisplay;
|
||||
x11->XScreenNumberOfScreen = XScreenNumberOfScreen;
|
||||
}
|
||||
#endif // DYNAMIC_LOAD_X11_FUNCTIONS
|
||||
|
||||
|
||||
|
||||
int GLAD_GLX_VERSION_1_0;
|
||||
int GLAD_GLX_VERSION_1_1;
|
||||
int GLAD_GLX_VERSION_1_2;
|
||||
int GLAD_GLX_VERSION_1_3;
|
||||
int GLAD_GLX_VERSION_1_4;
|
||||
int GLAD_GLX_3DFX_multisample;
|
||||
int GLAD_GLX_AMD_gpu_association;
|
||||
int GLAD_GLX_ARB_context_flush_control;
|
||||
int GLAD_GLX_ARB_create_context;
|
||||
int GLAD_GLX_ARB_create_context_no_error;
|
||||
int GLAD_GLX_ARB_create_context_profile;
|
||||
int GLAD_GLX_ARB_create_context_robustness;
|
||||
int GLAD_GLX_ARB_fbconfig_float;
|
||||
int GLAD_GLX_ARB_framebuffer_sRGB;
|
||||
int GLAD_GLX_ARB_get_proc_address;
|
||||
int GLAD_GLX_ARB_multisample;
|
||||
int GLAD_GLX_ARB_robustness_application_isolation;
|
||||
int GLAD_GLX_ARB_robustness_share_group_isolation;
|
||||
int GLAD_GLX_ARB_vertex_buffer_object;
|
||||
int GLAD_GLX_EXT_buffer_age;
|
||||
int GLAD_GLX_EXT_create_context_es2_profile;
|
||||
int GLAD_GLX_EXT_create_context_es_profile;
|
||||
int GLAD_GLX_EXT_fbconfig_packed_float;
|
||||
int GLAD_GLX_EXT_framebuffer_sRGB;
|
||||
int GLAD_GLX_EXT_import_context;
|
||||
int GLAD_GLX_EXT_libglvnd;
|
||||
int GLAD_GLX_EXT_no_config_context;
|
||||
int GLAD_GLX_EXT_stereo_tree;
|
||||
int GLAD_GLX_EXT_swap_control;
|
||||
int GLAD_GLX_EXT_swap_control_tear;
|
||||
int GLAD_GLX_EXT_texture_from_pixmap;
|
||||
int GLAD_GLX_EXT_visual_info;
|
||||
int GLAD_GLX_EXT_visual_rating;
|
||||
int GLAD_GLX_INTEL_swap_event;
|
||||
int GLAD_GLX_MESA_agp_offset;
|
||||
int GLAD_GLX_MESA_copy_sub_buffer;
|
||||
int GLAD_GLX_MESA_pixmap_colormap;
|
||||
int GLAD_GLX_MESA_query_renderer;
|
||||
int GLAD_GLX_MESA_release_buffers;
|
||||
int GLAD_GLX_MESA_set_3dfx_mode;
|
||||
int GLAD_GLX_MESA_swap_control;
|
||||
int GLAD_GLX_NV_copy_buffer;
|
||||
int GLAD_GLX_NV_copy_image;
|
||||
int GLAD_GLX_NV_delay_before_swap;
|
||||
int GLAD_GLX_NV_float_buffer;
|
||||
int GLAD_GLX_NV_multisample_coverage;
|
||||
int GLAD_GLX_NV_present_video;
|
||||
int GLAD_GLX_NV_robustness_video_memory_purge;
|
||||
int GLAD_GLX_NV_swap_group;
|
||||
int GLAD_GLX_NV_video_capture;
|
||||
int GLAD_GLX_NV_video_out;
|
||||
int GLAD_GLX_OML_swap_method;
|
||||
int GLAD_GLX_OML_sync_control;
|
||||
int GLAD_GLX_SGIS_blended_overlay;
|
||||
int GLAD_GLX_SGIS_multisample;
|
||||
int GLAD_GLX_SGIS_shared_multisample;
|
||||
int GLAD_GLX_SGIX_fbconfig;
|
||||
int GLAD_GLX_SGIX_hyperpipe;
|
||||
int GLAD_GLX_SGIX_pbuffer;
|
||||
int GLAD_GLX_SGIX_swap_barrier;
|
||||
int GLAD_GLX_SGIX_swap_group;
|
||||
int GLAD_GLX_SGIX_video_resize;
|
||||
int GLAD_GLX_SGIX_visual_select_group;
|
||||
int GLAD_GLX_SGI_cushion;
|
||||
int GLAD_GLX_SGI_make_current_read;
|
||||
int GLAD_GLX_SGI_swap_control;
|
||||
int GLAD_GLX_SGI_video_sync;
|
||||
int GLAD_GLX_SUN_get_transparent_index;
|
||||
|
||||
|
||||
PFNGLXCHOOSEFBCONFIGSGIXPROC glad_glXChooseFBConfigSGIX;
|
||||
PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC glad_glXCreateContextWithConfigSGIX;
|
||||
PFNGLXSELECTEVENTSGIXPROC glad_glXSelectEventSGIX;
|
||||
PFNGLXDELAYBEFORESWAPNVPROC glad_glXDelayBeforeSwapNV;
|
||||
PFNGLXWAITFORMSCOMLPROC glad_glXWaitForMscOML;
|
||||
PFNGLXQUERYGLXPBUFFERSGIXPROC glad_glXQueryGLXPbufferSGIX;
|
||||
PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress;
|
||||
PFNGLXCHANNELRECTSGIXPROC glad_glXChannelRectSGIX;
|
||||
PFNGLXCHOOSEVISUALPROC glad_glXChooseVisual;
|
||||
PFNGLXCREATEPIXMAPPROC glad_glXCreatePixmap;
|
||||
PFNGLXGETPROCADDRESSARBPROC glad_glXGetProcAddressARB;
|
||||
PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC glad_glXQueryHyperpipeAttribSGIX;
|
||||
PFNGLXCREATEGLXPIXMAPMESAPROC glad_glXCreateGLXPixmapMESA;
|
||||
PFNGLXISDIRECTPROC glad_glXIsDirect;
|
||||
PFNGLXGETCURRENTREADDRAWABLESGIPROC glad_glXGetCurrentReadDrawableSGI;
|
||||
PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC glad_glXGetCurrentAssociatedContextAMD;
|
||||
PFNGLXCOPYIMAGESUBDATANVPROC glad_glXCopyImageSubDataNV;
|
||||
PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC glad_glXCreateGLXPixmapWithConfigSGIX;
|
||||
PFNGLXGETFBCONFIGSPROC glad_glXGetFBConfigs;
|
||||
PFNGLXHYPERPIPEATTRIBSGIXPROC glad_glXHyperpipeAttribSGIX;
|
||||
PFNGLXCOPYBUFFERSUBDATANVPROC glad_glXCopyBufferSubDataNV;
|
||||
PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC glad_glXQueryVideoCaptureDeviceNV;
|
||||
PFNGLXJOINSWAPGROUPSGIXPROC glad_glXJoinSwapGroupSGIX;
|
||||
PFNGLXGETCURRENTCONTEXTPROC glad_glXGetCurrentContext;
|
||||
PFNGLXGETVISUALFROMFBCONFIGPROC glad_glXGetVisualFromFBConfig;
|
||||
PFNGLXGETCURRENTDISPLAYPROC glad_glXGetCurrentDisplay;
|
||||
PFNGLXQUERYHYPERPIPECONFIGSGIXPROC glad_glXQueryHyperpipeConfigSGIX;
|
||||
PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC glad_glXQueryHyperpipeBestAttribSGIX;
|
||||
PFNGLXGETFBCONFIGFROMVISUALSGIXPROC glad_glXGetFBConfigFromVisualSGIX;
|
||||
PFNGLXGETCLIENTSTRINGPROC glad_glXGetClientString;
|
||||
PFNGLXSELECTEVENTPROC glad_glXSelectEvent;
|
||||
PFNGLXGETVIDEODEVICENVPROC glad_glXGetVideoDeviceNV;
|
||||
PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC glad_glXQueryMaxSwapBarriersSGIX;
|
||||
PFNGLXCREATENEWCONTEXTPROC glad_glXCreateNewContext;
|
||||
PFNGLXQUERYCONTEXTPROC glad_glXQueryContext;
|
||||
PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC glad_glXReleaseVideoCaptureDeviceNV;
|
||||
PFNGLXDESTROYPBUFFERPROC glad_glXDestroyPbuffer;
|
||||
PFNGLXQUERYCONTEXTINFOEXTPROC glad_glXQueryContextInfoEXT;
|
||||
PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC glad_glXBlitContextFramebufferAMD;
|
||||
PFNGLXBINDCHANNELTOWINDOWSGIXPROC glad_glXBindChannelToWindowSGIX;
|
||||
PFNGLXSWAPBUFFERSPROC glad_glXSwapBuffers;
|
||||
PFNGLXQUERYRENDERERSTRINGMESAPROC glad_glXQueryRendererStringMESA;
|
||||
PFNGLXGETAGPOFFSETMESAPROC glad_glXGetAGPOffsetMESA;
|
||||
PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC glad_glXQueryCurrentRendererStringMESA;
|
||||
PFNGLXDESTROYGLXPBUFFERSGIXPROC glad_glXDestroyGLXPbufferSGIX;
|
||||
PFNGLXGETSYNCVALUESOMLPROC glad_glXGetSyncValuesOML;
|
||||
PFNGLXHYPERPIPECONFIGSGIXPROC glad_glXHyperpipeConfigSGIX;
|
||||
PFNGLXBINDVIDEOIMAGENVPROC glad_glXBindVideoImageNV;
|
||||
PFNGLXCREATEWINDOWPROC glad_glXCreateWindow;
|
||||
PFNGLXCREATEGLXPBUFFERSGIXPROC glad_glXCreateGLXPbufferSGIX;
|
||||
PFNGLXGETCONTEXTIDEXTPROC glad_glXGetContextIDEXT;
|
||||
PFNGLXGETSWAPINTERVALMESAPROC glad_glXGetSwapIntervalMESA;
|
||||
PFNGLXMAKECURRENTPROC glad_glXMakeCurrent;
|
||||
PFNGLXRESETFRAMECOUNTNVPROC glad_glXResetFrameCountNV;
|
||||
PFNGLXGETCONTEXTGPUIDAMDPROC glad_glXGetContextGPUIDAMD;
|
||||
PFNGLXQUERYDRAWABLEPROC glad_glXQueryDrawable;
|
||||
PFNGLXBINDVIDEODEVICENVPROC glad_glXBindVideoDeviceNV;
|
||||
PFNGLXCREATEGLXPIXMAPPROC glad_glXCreateGLXPixmap;
|
||||
PFNGLXJOINSWAPGROUPNVPROC glad_glXJoinSwapGroupNV;
|
||||
PFNGLXGETVIDEOSYNCSGIPROC glad_glXGetVideoSyncSGI;
|
||||
PFNGLXCUSHIONSGIPROC glad_glXCushionSGI;
|
||||
PFNGLXRELEASETEXIMAGEEXTPROC glad_glXReleaseTexImageEXT;
|
||||
PFNGLXQUERYCHANNELDELTASSGIXPROC glad_glXQueryChannelDeltasSGIX;
|
||||
PFNGLXQUERYFRAMECOUNTNVPROC glad_glXQueryFrameCountNV;
|
||||
PFNGLXQUERYVERSIONPROC glad_glXQueryVersion;
|
||||
PFNGLXWAITXPROC glad_glXWaitX;
|
||||
PFNGLXGETCONFIGPROC glad_glXGetConfig;
|
||||
PFNGLXSWAPINTERVALSGIPROC glad_glXSwapIntervalSGI;
|
||||
PFNGLXRELEASEVIDEODEVICENVPROC glad_glXReleaseVideoDeviceNV;
|
||||
PFNGLXCREATEPBUFFERPROC glad_glXCreatePbuffer;
|
||||
PFNGLXQUERYSWAPGROUPNVPROC glad_glXQuerySwapGroupNV;
|
||||
PFNGLXGETCURRENTREADDRAWABLEPROC glad_glXGetCurrentReadDrawable;
|
||||
PFNGLXMAKECONTEXTCURRENTPROC glad_glXMakeContextCurrent;
|
||||
PFNGLXBINDTEXIMAGEEXTPROC glad_glXBindTexImageEXT;
|
||||
PFNGLXGETSELECTEDEVENTSGIXPROC glad_glXGetSelectedEventSGIX;
|
||||
PFNGLXGETVISUALFROMFBCONFIGSGIXPROC glad_glXGetVisualFromFBConfigSGIX;
|
||||
PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC glad_glXMakeAssociatedContextCurrentAMD;
|
||||
PFNGLXWAITVIDEOSYNCSGIPROC glad_glXWaitVideoSyncSGI;
|
||||
PFNGLXGETGPUIDSAMDPROC glad_glXGetGPUIDsAMD;
|
||||
PFNGLXGETTRANSPARENTINDEXSUNPROC glad_glXGetTransparentIndexSUN;
|
||||
PFNGLXBINDHYPERPIPESGIXPROC glad_glXBindHyperpipeSGIX;
|
||||
PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC glad_glXNamedCopyBufferSubDataNV;
|
||||
PFNGLXUSEXFONTPROC glad_glXUseXFont;
|
||||
PFNGLXGETVIDEOINFONVPROC glad_glXGetVideoInfoNV;
|
||||
PFNGLXCHOOSEFBCONFIGPROC glad_glXChooseFBConfig;
|
||||
PFNGLXQUERYMAXSWAPGROUPSNVPROC glad_glXQueryMaxSwapGroupsNV;
|
||||
PFNGLXGETMSCRATEOMLPROC glad_glXGetMscRateOML;
|
||||
PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC glad_glXLockVideoCaptureDeviceNV;
|
||||
PFNGLXCOPYCONTEXTPROC glad_glXCopyContext;
|
||||
PFNGLXWAITFORSBCOMLPROC glad_glXWaitForSbcOML;
|
||||
PFNGLXBINDVIDEOCAPTUREDEVICENVPROC glad_glXBindVideoCaptureDeviceNV;
|
||||
PFNGLXIMPORTCONTEXTEXTPROC glad_glXImportContextEXT;
|
||||
PFNGLXSET3DFXMODEMESAPROC glad_glXSet3DfxModeMESA;
|
||||
PFNGLXDESTROYPIXMAPPROC glad_glXDestroyPixmap;
|
||||
PFNGLXQUERYEXTENSIONPROC glad_glXQueryExtension;
|
||||
PFNGLXQUERYHYPERPIPENETWORKSGIXPROC glad_glXQueryHyperpipeNetworkSGIX;
|
||||
PFNGLXDESTROYGLXPIXMAPPROC glad_glXDestroyGLXPixmap;
|
||||
PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC glad_glXEnumerateVideoCaptureDevicesNV;
|
||||
PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC glad_glXDestroyHyperpipeConfigSGIX;
|
||||
PFNGLXDESTROYWINDOWPROC glad_glXDestroyWindow;
|
||||
PFNGLXRELEASEVIDEOIMAGENVPROC glad_glXReleaseVideoImageNV;
|
||||
PFNGLXQUERYCHANNELRECTSGIXPROC glad_glXQueryChannelRectSGIX;
|
||||
PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC glad_glXCreateAssociatedContextAMD;
|
||||
PFNGLXENUMERATEVIDEODEVICESNVPROC glad_glXEnumerateVideoDevicesNV;
|
||||
PFNGLXGETCURRENTDRAWABLEPROC glad_glXGetCurrentDrawable;
|
||||
PFNGLXGETSELECTEDEVENTPROC glad_glXGetSelectedEvent;
|
||||
PFNGLXSWAPINTERVALMESAPROC glad_glXSwapIntervalMESA;
|
||||
PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glad_glXQueryCurrentRendererIntegerMESA;
|
||||
PFNGLXCHANNELRECTSYNCSGIXPROC glad_glXChannelRectSyncSGIX;
|
||||
PFNGLXSWAPBUFFERSMSCOMLPROC glad_glXSwapBuffersMscOML;
|
||||
PFNGLXQUERYEXTENSIONSSTRINGPROC glad_glXQueryExtensionsString;
|
||||
PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC glad_glXCreateAssociatedContextAttribsAMD;
|
||||
PFNGLXSENDPBUFFERTOVIDEONVPROC glad_glXSendPbufferToVideoNV;
|
||||
PFNGLXCREATECONTEXTPROC glad_glXCreateContext;
|
||||
PFNGLXGETCURRENTDISPLAYEXTPROC glad_glXGetCurrentDisplayEXT;
|
||||
PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC glad_glXDeleteAssociatedContextAMD;
|
||||
PFNGLXDESTROYCONTEXTPROC glad_glXDestroyContext;
|
||||
PFNGLXQUERYSERVERSTRINGPROC glad_glXQueryServerString;
|
||||
PFNGLXWAITGLPROC glad_glXWaitGL;
|
||||
PFNGLXCREATECONTEXTATTRIBSARBPROC glad_glXCreateContextAttribsARB;
|
||||
PFNGLXBINDSWAPBARRIERSGIXPROC glad_glXBindSwapBarrierSGIX;
|
||||
PFNGLXFREECONTEXTEXTPROC glad_glXFreeContextEXT;
|
||||
PFNGLXGETFBCONFIGATTRIBPROC glad_glXGetFBConfigAttrib;
|
||||
PFNGLXCOPYSUBBUFFERMESAPROC glad_glXCopySubBufferMESA;
|
||||
PFNGLXGETGPUINFOAMDPROC glad_glXGetGPUInfoAMD;
|
||||
PFNGLXRELEASEBUFFERSMESAPROC glad_glXReleaseBuffersMESA;
|
||||
PFNGLXSWAPINTERVALEXTPROC glad_glXSwapIntervalEXT;
|
||||
PFNGLXMAKECURRENTREADSGIPROC glad_glXMakeCurrentReadSGI;
|
||||
PFNGLXQUERYRENDERERINTEGERMESAPROC glad_glXQueryRendererIntegerMESA;
|
||||
PFNGLXBINDSWAPBARRIERNVPROC glad_glXBindSwapBarrierNV;
|
||||
PFNGLXGETFBCONFIGATTRIBSGIXPROC glad_glXGetFBConfigAttribSGIX;
|
||||
|
||||
static void load_GLX_VERSION_1_0(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_VERSION_1_0) return;
|
||||
glad_glXQueryVersion = (PFNGLXQUERYVERSIONPROC)load("glXQueryVersion", userptr);
|
||||
glad_glXIsDirect = (PFNGLXISDIRECTPROC)load("glXIsDirect", userptr);
|
||||
glad_glXChooseVisual = (PFNGLXCHOOSEVISUALPROC)load("glXChooseVisual", userptr);
|
||||
glad_glXGetConfig = (PFNGLXGETCONFIGPROC)load("glXGetConfig", userptr);
|
||||
glad_glXUseXFont = (PFNGLXUSEXFONTPROC)load("glXUseXFont", userptr);
|
||||
glad_glXCreateGLXPixmap = (PFNGLXCREATEGLXPIXMAPPROC)load("glXCreateGLXPixmap", userptr);
|
||||
glad_glXCopyContext = (PFNGLXCOPYCONTEXTPROC)load("glXCopyContext", userptr);
|
||||
glad_glXWaitGL = (PFNGLXWAITGLPROC)load("glXWaitGL", userptr);
|
||||
glad_glXQueryExtension = (PFNGLXQUERYEXTENSIONPROC)load("glXQueryExtension", userptr);
|
||||
glad_glXWaitX = (PFNGLXWAITXPROC)load("glXWaitX", userptr);
|
||||
glad_glXGetCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC)load("glXGetCurrentContext", userptr);
|
||||
glad_glXMakeCurrent = (PFNGLXMAKECURRENTPROC)load("glXMakeCurrent", userptr);
|
||||
glad_glXSwapBuffers = (PFNGLXSWAPBUFFERSPROC)load("glXSwapBuffers", userptr);
|
||||
glad_glXDestroyContext = (PFNGLXDESTROYCONTEXTPROC)load("glXDestroyContext", userptr);
|
||||
glad_glXGetCurrentDrawable = (PFNGLXGETCURRENTDRAWABLEPROC)load("glXGetCurrentDrawable", userptr);
|
||||
glad_glXCreateContext = (PFNGLXCREATECONTEXTPROC)load("glXCreateContext", userptr);
|
||||
glad_glXDestroyGLXPixmap = (PFNGLXDESTROYGLXPIXMAPPROC)load("glXDestroyGLXPixmap", userptr);
|
||||
}
|
||||
static void load_GLX_VERSION_1_1(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_VERSION_1_1) return;
|
||||
glad_glXQueryServerString = (PFNGLXQUERYSERVERSTRINGPROC)load("glXQueryServerString", userptr);
|
||||
glad_glXGetClientString = (PFNGLXGETCLIENTSTRINGPROC)load("glXGetClientString", userptr);
|
||||
glad_glXQueryExtensionsString = (PFNGLXQUERYEXTENSIONSSTRINGPROC)load("glXQueryExtensionsString", userptr);
|
||||
}
|
||||
static void load_GLX_VERSION_1_2(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_VERSION_1_2) return;
|
||||
glad_glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)load("glXGetCurrentDisplay", userptr);
|
||||
}
|
||||
static void load_GLX_VERSION_1_3(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_VERSION_1_3) return;
|
||||
glad_glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)load("glXChooseFBConfig", userptr);
|
||||
glad_glXSelectEvent = (PFNGLXSELECTEVENTPROC)load("glXSelectEvent", userptr);
|
||||
glad_glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)load("glXCreatePixmap", userptr);
|
||||
glad_glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)load("glXCreateNewContext", userptr);
|
||||
glad_glXQueryContext = (PFNGLXQUERYCONTEXTPROC)load("glXQueryContext", userptr);
|
||||
glad_glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)load("glXDestroyPixmap", userptr);
|
||||
glad_glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)load("glXDestroyWindow", userptr);
|
||||
glad_glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)load("glXCreatePbuffer", userptr);
|
||||
glad_glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)load("glXDestroyPbuffer", userptr);
|
||||
glad_glXCreateWindow = (PFNGLXCREATEWINDOWPROC)load("glXCreateWindow", userptr);
|
||||
glad_glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)load("glXGetVisualFromFBConfig", userptr);
|
||||
glad_glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)load("glXGetCurrentReadDrawable", userptr);
|
||||
glad_glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)load("glXMakeContextCurrent", userptr);
|
||||
glad_glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)load("glXGetFBConfigAttrib", userptr);
|
||||
glad_glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)load("glXQueryDrawable", userptr);
|
||||
glad_glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)load("glXGetFBConfigs", userptr);
|
||||
glad_glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)load("glXGetSelectedEvent", userptr);
|
||||
}
|
||||
static void load_GLX_VERSION_1_4(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_VERSION_1_4) return;
|
||||
glad_glXGetProcAddress = (PFNGLXGETPROCADDRESSPROC)load("glXGetProcAddress", userptr);
|
||||
}
|
||||
static void load_GLX_3DFX_multisample(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_AMD_gpu_association(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_AMD_gpu_association) return;
|
||||
glad_glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)load("glXMakeAssociatedContextCurrentAMD", userptr);
|
||||
glad_glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)load("glXGetGPUInfoAMD", userptr);
|
||||
glad_glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)load("glXDeleteAssociatedContextAMD", userptr);
|
||||
glad_glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)load("glXGetGPUIDsAMD", userptr);
|
||||
glad_glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)load("glXGetCurrentAssociatedContextAMD", userptr);
|
||||
glad_glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)load("glXCreateAssociatedContextAMD", userptr);
|
||||
glad_glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)load("glXBlitContextFramebufferAMD", userptr);
|
||||
glad_glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)load("glXCreateAssociatedContextAttribsAMD", userptr);
|
||||
glad_glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)load("glXGetContextGPUIDAMD", userptr);
|
||||
}
|
||||
static void load_GLX_ARB_context_flush_control(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_create_context(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_ARB_create_context) return;
|
||||
glad_glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)load("glXCreateContextAttribsARB", userptr);
|
||||
}
|
||||
static void load_GLX_ARB_create_context_no_error(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_create_context_profile(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_create_context_robustness(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_fbconfig_float(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_framebuffer_sRGB(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_get_proc_address(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_ARB_get_proc_address) return;
|
||||
glad_glXGetProcAddressARB = (PFNGLXGETPROCADDRESSARBPROC)load("glXGetProcAddressARB", userptr);
|
||||
}
|
||||
static void load_GLX_ARB_multisample(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_robustness_application_isolation(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_robustness_share_group_isolation(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_ARB_vertex_buffer_object(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_buffer_age(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_create_context_es2_profile(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_create_context_es_profile(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_fbconfig_packed_float(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_framebuffer_sRGB(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_import_context(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_EXT_import_context) return;
|
||||
glad_glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)load("glXQueryContextInfoEXT", userptr);
|
||||
glad_glXGetCurrentDisplayEXT = (PFNGLXGETCURRENTDISPLAYEXTPROC)load("glXGetCurrentDisplayEXT", userptr);
|
||||
glad_glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)load("glXGetContextIDEXT", userptr);
|
||||
glad_glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)load("glXFreeContextEXT", userptr);
|
||||
glad_glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)load("glXImportContextEXT", userptr);
|
||||
}
|
||||
static void load_GLX_EXT_libglvnd(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_no_config_context(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_stereo_tree(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_swap_control(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_EXT_swap_control) return;
|
||||
glad_glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)load("glXSwapIntervalEXT", userptr);
|
||||
}
|
||||
static void load_GLX_EXT_swap_control_tear(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_texture_from_pixmap(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_EXT_texture_from_pixmap) return;
|
||||
glad_glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)load("glXReleaseTexImageEXT", userptr);
|
||||
glad_glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)load("glXBindTexImageEXT", userptr);
|
||||
}
|
||||
static void load_GLX_EXT_visual_info(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_EXT_visual_rating(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_INTEL_swap_event(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_MESA_agp_offset(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_MESA_agp_offset) return;
|
||||
glad_glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)load("glXGetAGPOffsetMESA", userptr);
|
||||
}
|
||||
static void load_GLX_MESA_copy_sub_buffer(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_MESA_copy_sub_buffer) return;
|
||||
glad_glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)load("glXCopySubBufferMESA", userptr);
|
||||
}
|
||||
static void load_GLX_MESA_pixmap_colormap(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_MESA_pixmap_colormap) return;
|
||||
glad_glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)load("glXCreateGLXPixmapMESA", userptr);
|
||||
}
|
||||
static void load_GLX_MESA_query_renderer(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_MESA_query_renderer) return;
|
||||
glad_glXQueryCurrentRendererStringMESA = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)load("glXQueryCurrentRendererStringMESA", userptr);
|
||||
glad_glXQueryRendererIntegerMESA = (PFNGLXQUERYRENDERERINTEGERMESAPROC)load("glXQueryRendererIntegerMESA", userptr);
|
||||
glad_glXQueryRendererStringMESA = (PFNGLXQUERYRENDERERSTRINGMESAPROC)load("glXQueryRendererStringMESA", userptr);
|
||||
glad_glXQueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)load("glXQueryCurrentRendererIntegerMESA", userptr);
|
||||
}
|
||||
static void load_GLX_MESA_release_buffers(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_MESA_release_buffers) return;
|
||||
glad_glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)load("glXReleaseBuffersMESA", userptr);
|
||||
}
|
||||
static void load_GLX_MESA_set_3dfx_mode(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_MESA_set_3dfx_mode) return;
|
||||
glad_glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)load("glXSet3DfxModeMESA", userptr);
|
||||
}
|
||||
static void load_GLX_MESA_swap_control(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_MESA_swap_control) return;
|
||||
glad_glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)load("glXGetSwapIntervalMESA", userptr);
|
||||
glad_glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)load("glXSwapIntervalMESA", userptr);
|
||||
}
|
||||
static void load_GLX_NV_copy_buffer(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_NV_copy_buffer) return;
|
||||
glad_glXNamedCopyBufferSubDataNV = (PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC)load("glXNamedCopyBufferSubDataNV", userptr);
|
||||
glad_glXCopyBufferSubDataNV = (PFNGLXCOPYBUFFERSUBDATANVPROC)load("glXCopyBufferSubDataNV", userptr);
|
||||
}
|
||||
static void load_GLX_NV_copy_image(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_NV_copy_image) return;
|
||||
glad_glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)load("glXCopyImageSubDataNV", userptr);
|
||||
}
|
||||
static void load_GLX_NV_delay_before_swap(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_NV_delay_before_swap) return;
|
||||
glad_glXDelayBeforeSwapNV = (PFNGLXDELAYBEFORESWAPNVPROC)load("glXDelayBeforeSwapNV", userptr);
|
||||
}
|
||||
static void load_GLX_NV_float_buffer(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_NV_multisample_coverage(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_NV_present_video(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_NV_present_video) return;
|
||||
glad_glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)load("glXEnumerateVideoDevicesNV", userptr);
|
||||
glad_glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)load("glXBindVideoDeviceNV", userptr);
|
||||
}
|
||||
static void load_GLX_NV_robustness_video_memory_purge(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_NV_swap_group(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_NV_swap_group) return;
|
||||
glad_glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)load("glXQueryMaxSwapGroupsNV", userptr);
|
||||
glad_glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)load("glXQuerySwapGroupNV", userptr);
|
||||
glad_glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)load("glXJoinSwapGroupNV", userptr);
|
||||
glad_glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)load("glXResetFrameCountNV", userptr);
|
||||
glad_glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)load("glXBindSwapBarrierNV", userptr);
|
||||
glad_glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)load("glXQueryFrameCountNV", userptr);
|
||||
}
|
||||
static void load_GLX_NV_video_capture(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_NV_video_capture) return;
|
||||
glad_glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)load("glXLockVideoCaptureDeviceNV", userptr);
|
||||
glad_glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)load("glXBindVideoCaptureDeviceNV", userptr);
|
||||
glad_glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)load("glXQueryVideoCaptureDeviceNV", userptr);
|
||||
glad_glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)load("glXReleaseVideoCaptureDeviceNV", userptr);
|
||||
glad_glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)load("glXEnumerateVideoCaptureDevicesNV", userptr);
|
||||
}
|
||||
static void load_GLX_NV_video_out(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_NV_video_out) return;
|
||||
glad_glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)load("glXGetVideoDeviceNV", userptr);
|
||||
glad_glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)load("glXReleaseVideoImageNV", userptr);
|
||||
glad_glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)load("glXReleaseVideoDeviceNV", userptr);
|
||||
glad_glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)load("glXBindVideoImageNV", userptr);
|
||||
glad_glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)load("glXSendPbufferToVideoNV", userptr);
|
||||
glad_glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)load("glXGetVideoInfoNV", userptr);
|
||||
}
|
||||
static void load_GLX_OML_swap_method(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_OML_sync_control(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_OML_sync_control) return;
|
||||
glad_glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)load("glXWaitForMscOML", userptr);
|
||||
glad_glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)load("glXSwapBuffersMscOML", userptr);
|
||||
glad_glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)load("glXGetMscRateOML", userptr);
|
||||
glad_glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)load("glXWaitForSbcOML", userptr);
|
||||
glad_glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)load("glXGetSyncValuesOML", userptr);
|
||||
}
|
||||
static void load_GLX_SGIS_blended_overlay(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_SGIS_multisample(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_SGIS_shared_multisample(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_SGIX_fbconfig(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGIX_fbconfig) return;
|
||||
glad_glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)load("glXChooseFBConfigSGIX", userptr);
|
||||
glad_glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)load("glXGetVisualFromFBConfigSGIX", userptr);
|
||||
glad_glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)load("glXCreateContextWithConfigSGIX", userptr);
|
||||
glad_glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)load("glXCreateGLXPixmapWithConfigSGIX", userptr);
|
||||
glad_glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)load("glXGetFBConfigFromVisualSGIX", userptr);
|
||||
glad_glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)load("glXGetFBConfigAttribSGIX", userptr);
|
||||
}
|
||||
static void load_GLX_SGIX_hyperpipe(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGIX_hyperpipe) return;
|
||||
glad_glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)load("glXHyperpipeAttribSGIX", userptr);
|
||||
glad_glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)load("glXDestroyHyperpipeConfigSGIX", userptr);
|
||||
glad_glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)load("glXHyperpipeConfigSGIX", userptr);
|
||||
glad_glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)load("glXQueryHyperpipeAttribSGIX", userptr);
|
||||
glad_glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)load("glXBindHyperpipeSGIX", userptr);
|
||||
glad_glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)load("glXQueryHyperpipeNetworkSGIX", userptr);
|
||||
glad_glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)load("glXQueryHyperpipeConfigSGIX", userptr);
|
||||
glad_glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)load("glXQueryHyperpipeBestAttribSGIX", userptr);
|
||||
}
|
||||
static void load_GLX_SGIX_pbuffer(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGIX_pbuffer) return;
|
||||
glad_glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)load("glXGetSelectedEventSGIX", userptr);
|
||||
glad_glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)load("glXDestroyGLXPbufferSGIX", userptr);
|
||||
glad_glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)load("glXCreateGLXPbufferSGIX", userptr);
|
||||
glad_glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)load("glXQueryGLXPbufferSGIX", userptr);
|
||||
glad_glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)load("glXSelectEventSGIX", userptr);
|
||||
}
|
||||
static void load_GLX_SGIX_swap_barrier(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGIX_swap_barrier) return;
|
||||
glad_glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)load("glXQueryMaxSwapBarriersSGIX", userptr);
|
||||
glad_glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)load("glXBindSwapBarrierSGIX", userptr);
|
||||
}
|
||||
static void load_GLX_SGIX_swap_group(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGIX_swap_group) return;
|
||||
glad_glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)load("glXJoinSwapGroupSGIX", userptr);
|
||||
}
|
||||
static void load_GLX_SGIX_video_resize(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGIX_video_resize) return;
|
||||
glad_glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)load("glXChannelRectSGIX", userptr);
|
||||
glad_glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)load("glXQueryChannelRectSGIX", userptr);
|
||||
glad_glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)load("glXChannelRectSyncSGIX", userptr);
|
||||
glad_glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)load("glXBindChannelToWindowSGIX", userptr);
|
||||
glad_glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)load("glXQueryChannelDeltasSGIX", userptr);
|
||||
}
|
||||
static void load_GLX_SGIX_visual_select_group(GLADloadproc load, void* userptr) {
|
||||
}
|
||||
static void load_GLX_SGI_cushion(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGI_cushion) return;
|
||||
glad_glXCushionSGI = (PFNGLXCUSHIONSGIPROC)load("glXCushionSGI", userptr);
|
||||
}
|
||||
static void load_GLX_SGI_make_current_read(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGI_make_current_read) return;
|
||||
glad_glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)load("glXMakeCurrentReadSGI", userptr);
|
||||
glad_glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)load("glXGetCurrentReadDrawableSGI", userptr);
|
||||
}
|
||||
static void load_GLX_SGI_swap_control(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGI_swap_control) return;
|
||||
glad_glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)load("glXSwapIntervalSGI", userptr);
|
||||
}
|
||||
static void load_GLX_SGI_video_sync(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SGI_video_sync) return;
|
||||
glad_glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)load("glXGetVideoSyncSGI", userptr);
|
||||
glad_glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)load("glXWaitVideoSyncSGI", userptr);
|
||||
}
|
||||
static void load_GLX_SUN_get_transparent_index(GLADloadproc load, void* userptr) {
|
||||
if(!GLAD_GLX_SUN_get_transparent_index) return;
|
||||
glad_glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)load("glXGetTransparentIndexSUN", userptr);
|
||||
}
|
||||
|
||||
|
||||
static int has_ext(Display *display, int screen, const char *ext) {
|
||||
const char *terminator;
|
||||
const char *loc;
|
||||
const char *extensions;
|
||||
|
||||
if(!GLAD_GLX_VERSION_1_1)
|
||||
return 0;
|
||||
|
||||
extensions = glXQueryExtensionsString(display, screen);
|
||||
|
||||
if(extensions == NULL || ext == NULL)
|
||||
return 0;
|
||||
|
||||
while(1) {
|
||||
loc = strstr(extensions, ext);
|
||||
if(loc == NULL)
|
||||
break;
|
||||
|
||||
terminator = loc + strlen(ext);
|
||||
if((loc == extensions || *(loc - 1) == ' ') &&
|
||||
(*terminator == ' ' || *terminator == '\0'))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
extensions = terminator;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int find_extensionsGLX(Display *display, int screen) {
|
||||
GLAD_GLX_3DFX_multisample = has_ext(display, screen, "GLX_3DFX_multisample");
|
||||
GLAD_GLX_AMD_gpu_association = has_ext(display, screen, "GLX_AMD_gpu_association");
|
||||
GLAD_GLX_ARB_context_flush_control = has_ext(display, screen, "GLX_ARB_context_flush_control");
|
||||
GLAD_GLX_ARB_create_context = has_ext(display, screen, "GLX_ARB_create_context");
|
||||
GLAD_GLX_ARB_create_context_no_error = has_ext(display, screen, "GLX_ARB_create_context_no_error");
|
||||
GLAD_GLX_ARB_create_context_profile = has_ext(display, screen, "GLX_ARB_create_context_profile");
|
||||
GLAD_GLX_ARB_create_context_robustness = has_ext(display, screen, "GLX_ARB_create_context_robustness");
|
||||
GLAD_GLX_ARB_fbconfig_float = has_ext(display, screen, "GLX_ARB_fbconfig_float");
|
||||
GLAD_GLX_ARB_framebuffer_sRGB = has_ext(display, screen, "GLX_ARB_framebuffer_sRGB");
|
||||
GLAD_GLX_ARB_get_proc_address = has_ext(display, screen, "GLX_ARB_get_proc_address");
|
||||
GLAD_GLX_ARB_multisample = has_ext(display, screen, "GLX_ARB_multisample");
|
||||
GLAD_GLX_ARB_robustness_application_isolation = has_ext(display, screen, "GLX_ARB_robustness_application_isolation");
|
||||
GLAD_GLX_ARB_robustness_share_group_isolation = has_ext(display, screen, "GLX_ARB_robustness_share_group_isolation");
|
||||
GLAD_GLX_ARB_vertex_buffer_object = has_ext(display, screen, "GLX_ARB_vertex_buffer_object");
|
||||
GLAD_GLX_EXT_buffer_age = has_ext(display, screen, "GLX_EXT_buffer_age");
|
||||
GLAD_GLX_EXT_create_context_es2_profile = has_ext(display, screen, "GLX_EXT_create_context_es2_profile");
|
||||
GLAD_GLX_EXT_create_context_es_profile = has_ext(display, screen, "GLX_EXT_create_context_es_profile");
|
||||
GLAD_GLX_EXT_fbconfig_packed_float = has_ext(display, screen, "GLX_EXT_fbconfig_packed_float");
|
||||
GLAD_GLX_EXT_framebuffer_sRGB = has_ext(display, screen, "GLX_EXT_framebuffer_sRGB");
|
||||
GLAD_GLX_EXT_import_context = has_ext(display, screen, "GLX_EXT_import_context");
|
||||
GLAD_GLX_EXT_libglvnd = has_ext(display, screen, "GLX_EXT_libglvnd");
|
||||
GLAD_GLX_EXT_no_config_context = has_ext(display, screen, "GLX_EXT_no_config_context");
|
||||
GLAD_GLX_EXT_stereo_tree = has_ext(display, screen, "GLX_EXT_stereo_tree");
|
||||
GLAD_GLX_EXT_swap_control = has_ext(display, screen, "GLX_EXT_swap_control");
|
||||
GLAD_GLX_EXT_swap_control_tear = has_ext(display, screen, "GLX_EXT_swap_control_tear");
|
||||
GLAD_GLX_EXT_texture_from_pixmap = has_ext(display, screen, "GLX_EXT_texture_from_pixmap");
|
||||
GLAD_GLX_EXT_visual_info = has_ext(display, screen, "GLX_EXT_visual_info");
|
||||
GLAD_GLX_EXT_visual_rating = has_ext(display, screen, "GLX_EXT_visual_rating");
|
||||
GLAD_GLX_INTEL_swap_event = has_ext(display, screen, "GLX_INTEL_swap_event");
|
||||
GLAD_GLX_MESA_agp_offset = has_ext(display, screen, "GLX_MESA_agp_offset");
|
||||
GLAD_GLX_MESA_copy_sub_buffer = has_ext(display, screen, "GLX_MESA_copy_sub_buffer");
|
||||
GLAD_GLX_MESA_pixmap_colormap = has_ext(display, screen, "GLX_MESA_pixmap_colormap");
|
||||
GLAD_GLX_MESA_query_renderer = has_ext(display, screen, "GLX_MESA_query_renderer");
|
||||
GLAD_GLX_MESA_release_buffers = has_ext(display, screen, "GLX_MESA_release_buffers");
|
||||
GLAD_GLX_MESA_set_3dfx_mode = has_ext(display, screen, "GLX_MESA_set_3dfx_mode");
|
||||
GLAD_GLX_MESA_swap_control = has_ext(display, screen, "GLX_MESA_swap_control");
|
||||
GLAD_GLX_NV_copy_buffer = has_ext(display, screen, "GLX_NV_copy_buffer");
|
||||
GLAD_GLX_NV_copy_image = has_ext(display, screen, "GLX_NV_copy_image");
|
||||
GLAD_GLX_NV_delay_before_swap = has_ext(display, screen, "GLX_NV_delay_before_swap");
|
||||
GLAD_GLX_NV_float_buffer = has_ext(display, screen, "GLX_NV_float_buffer");
|
||||
GLAD_GLX_NV_multisample_coverage = has_ext(display, screen, "GLX_NV_multisample_coverage");
|
||||
GLAD_GLX_NV_present_video = has_ext(display, screen, "GLX_NV_present_video");
|
||||
GLAD_GLX_NV_robustness_video_memory_purge = has_ext(display, screen, "GLX_NV_robustness_video_memory_purge");
|
||||
GLAD_GLX_NV_swap_group = has_ext(display, screen, "GLX_NV_swap_group");
|
||||
GLAD_GLX_NV_video_capture = has_ext(display, screen, "GLX_NV_video_capture");
|
||||
GLAD_GLX_NV_video_out = has_ext(display, screen, "GLX_NV_video_out");
|
||||
GLAD_GLX_OML_swap_method = has_ext(display, screen, "GLX_OML_swap_method");
|
||||
GLAD_GLX_OML_sync_control = has_ext(display, screen, "GLX_OML_sync_control");
|
||||
GLAD_GLX_SGIS_blended_overlay = has_ext(display, screen, "GLX_SGIS_blended_overlay");
|
||||
GLAD_GLX_SGIS_multisample = has_ext(display, screen, "GLX_SGIS_multisample");
|
||||
GLAD_GLX_SGIS_shared_multisample = has_ext(display, screen, "GLX_SGIS_shared_multisample");
|
||||
GLAD_GLX_SGIX_fbconfig = has_ext(display, screen, "GLX_SGIX_fbconfig");
|
||||
GLAD_GLX_SGIX_hyperpipe = has_ext(display, screen, "GLX_SGIX_hyperpipe");
|
||||
GLAD_GLX_SGIX_pbuffer = has_ext(display, screen, "GLX_SGIX_pbuffer");
|
||||
GLAD_GLX_SGIX_swap_barrier = has_ext(display, screen, "GLX_SGIX_swap_barrier");
|
||||
GLAD_GLX_SGIX_swap_group = has_ext(display, screen, "GLX_SGIX_swap_group");
|
||||
GLAD_GLX_SGIX_video_resize = has_ext(display, screen, "GLX_SGIX_video_resize");
|
||||
GLAD_GLX_SGIX_visual_select_group = has_ext(display, screen, "GLX_SGIX_visual_select_group");
|
||||
GLAD_GLX_SGI_cushion = has_ext(display, screen, "GLX_SGI_cushion");
|
||||
GLAD_GLX_SGI_make_current_read = has_ext(display, screen, "GLX_SGI_make_current_read");
|
||||
GLAD_GLX_SGI_swap_control = has_ext(display, screen, "GLX_SGI_swap_control");
|
||||
GLAD_GLX_SGI_video_sync = has_ext(display, screen, "GLX_SGI_video_sync");
|
||||
GLAD_GLX_SUN_get_transparent_index = has_ext(display, screen, "GLX_SUN_get_transparent_index");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int find_coreGLX(Display **display, int *screen) {
|
||||
X11Struct x11;
|
||||
initX11Struct(&x11);
|
||||
int major = 0, minor = 0;
|
||||
if(*display == NULL) {
|
||||
*display = x11.XOpenDisplay(0);
|
||||
if (*display == NULL) {
|
||||
return 0;
|
||||
}
|
||||
*screen = x11.XScreenNumberOfScreen(x11.XDefaultScreenOfDisplay(*display));
|
||||
}
|
||||
glXQueryVersion(*display, &major, &minor);
|
||||
GLAD_GLX_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
|
||||
GLAD_GLX_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
|
||||
GLAD_GLX_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
|
||||
GLAD_GLX_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
|
||||
GLAD_GLX_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
|
||||
return major * 10 + minor;
|
||||
}
|
||||
|
||||
int gladLoadGLX(Display *display, int screen, GLADloadproc load, void* userptr) {
|
||||
int version;
|
||||
glXQueryVersion = (PFNGLXQUERYVERSIONPROC)load("glXQueryVersion", userptr);
|
||||
if(glXQueryVersion == NULL) return 0;
|
||||
version = find_coreGLX(&display, &screen);
|
||||
|
||||
load_GLX_VERSION_1_0(load, userptr);
|
||||
load_GLX_VERSION_1_1(load, userptr);
|
||||
load_GLX_VERSION_1_2(load, userptr);
|
||||
load_GLX_VERSION_1_3(load, userptr);
|
||||
load_GLX_VERSION_1_4(load, userptr);
|
||||
|
||||
if (!find_extensionsGLX(display, screen)) return 0;
|
||||
load_GLX_3DFX_multisample(load, userptr);
|
||||
load_GLX_AMD_gpu_association(load, userptr);
|
||||
load_GLX_ARB_context_flush_control(load, userptr);
|
||||
load_GLX_ARB_create_context(load, userptr);
|
||||
load_GLX_ARB_create_context_no_error(load, userptr);
|
||||
load_GLX_ARB_create_context_profile(load, userptr);
|
||||
load_GLX_ARB_create_context_robustness(load, userptr);
|
||||
load_GLX_ARB_fbconfig_float(load, userptr);
|
||||
load_GLX_ARB_framebuffer_sRGB(load, userptr);
|
||||
load_GLX_ARB_get_proc_address(load, userptr);
|
||||
load_GLX_ARB_multisample(load, userptr);
|
||||
load_GLX_ARB_robustness_application_isolation(load, userptr);
|
||||
load_GLX_ARB_robustness_share_group_isolation(load, userptr);
|
||||
load_GLX_ARB_vertex_buffer_object(load, userptr);
|
||||
load_GLX_EXT_buffer_age(load, userptr);
|
||||
load_GLX_EXT_create_context_es2_profile(load, userptr);
|
||||
load_GLX_EXT_create_context_es_profile(load, userptr);
|
||||
load_GLX_EXT_fbconfig_packed_float(load, userptr);
|
||||
load_GLX_EXT_framebuffer_sRGB(load, userptr);
|
||||
load_GLX_EXT_import_context(load, userptr);
|
||||
load_GLX_EXT_libglvnd(load, userptr);
|
||||
load_GLX_EXT_no_config_context(load, userptr);
|
||||
load_GLX_EXT_stereo_tree(load, userptr);
|
||||
load_GLX_EXT_swap_control(load, userptr);
|
||||
load_GLX_EXT_swap_control_tear(load, userptr);
|
||||
load_GLX_EXT_texture_from_pixmap(load, userptr);
|
||||
load_GLX_EXT_visual_info(load, userptr);
|
||||
load_GLX_EXT_visual_rating(load, userptr);
|
||||
load_GLX_INTEL_swap_event(load, userptr);
|
||||
load_GLX_MESA_agp_offset(load, userptr);
|
||||
load_GLX_MESA_copy_sub_buffer(load, userptr);
|
||||
load_GLX_MESA_pixmap_colormap(load, userptr);
|
||||
load_GLX_MESA_query_renderer(load, userptr);
|
||||
load_GLX_MESA_release_buffers(load, userptr);
|
||||
load_GLX_MESA_set_3dfx_mode(load, userptr);
|
||||
load_GLX_MESA_swap_control(load, userptr);
|
||||
load_GLX_NV_copy_buffer(load, userptr);
|
||||
load_GLX_NV_copy_image(load, userptr);
|
||||
load_GLX_NV_delay_before_swap(load, userptr);
|
||||
load_GLX_NV_float_buffer(load, userptr);
|
||||
load_GLX_NV_multisample_coverage(load, userptr);
|
||||
load_GLX_NV_present_video(load, userptr);
|
||||
load_GLX_NV_robustness_video_memory_purge(load, userptr);
|
||||
load_GLX_NV_swap_group(load, userptr);
|
||||
load_GLX_NV_video_capture(load, userptr);
|
||||
load_GLX_NV_video_out(load, userptr);
|
||||
load_GLX_OML_swap_method(load, userptr);
|
||||
load_GLX_OML_sync_control(load, userptr);
|
||||
load_GLX_SGIS_blended_overlay(load, userptr);
|
||||
load_GLX_SGIS_multisample(load, userptr);
|
||||
load_GLX_SGIS_shared_multisample(load, userptr);
|
||||
load_GLX_SGIX_fbconfig(load, userptr);
|
||||
load_GLX_SGIX_hyperpipe(load, userptr);
|
||||
load_GLX_SGIX_pbuffer(load, userptr);
|
||||
load_GLX_SGIX_swap_barrier(load, userptr);
|
||||
load_GLX_SGIX_swap_group(load, userptr);
|
||||
load_GLX_SGIX_video_resize(load, userptr);
|
||||
load_GLX_SGIX_visual_select_group(load, userptr);
|
||||
load_GLX_SGI_cushion(load, userptr);
|
||||
load_GLX_SGI_make_current_read(load, userptr);
|
||||
load_GLX_SGI_swap_control(load, userptr);
|
||||
load_GLX_SGI_video_sync(load, userptr);
|
||||
load_GLX_SUN_get_transparent_index(load, userptr);
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
static void* glad_glx_get_proc_from_userptr(const char* name, void *userptr) {
|
||||
return ((void* (*)(const char *name))userptr)(name);
|
||||
}
|
||||
|
||||
int gladLoadGLXSimple(Display *display, int screen, GLADsimpleloadproc load) {
|
||||
return gladLoadGLX(display, screen, glad_glx_get_proc_from_userptr, (void*) load);
|
||||
}
|
||||
|
||||
|
||||
#ifdef GLAD_GLX
|
||||
|
||||
#ifndef __glad_loader_library_c_
|
||||
#define __glad_loader_library_c_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
|
||||
static void* glad_get_dlopen_handle(const char *lib_names[], int length) {
|
||||
int i;
|
||||
void *handle;
|
||||
|
||||
for (i = 0; i < length; ++i) {
|
||||
#ifdef _WIN32
|
||||
handle = LoadLibraryA(lib_names[i]);
|
||||
#else
|
||||
handle = dlopen(lib_names[i], RTLD_LAZY | RTLD_LOCAL);
|
||||
#endif
|
||||
if (handle != NULL) {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void glad_close_dlopen_handle(void* handle) {
|
||||
if (handle != NULL) {
|
||||
#ifdef _WIN32
|
||||
FreeLibrary((HMODULE) handle);
|
||||
#else
|
||||
dlclose(handle);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void* glad_dlsym_handle(void* handle, const char *name) {
|
||||
if (handle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
return (void*) GetProcAddress((HMODULE) handle, name);
|
||||
#else
|
||||
return dlsym(handle, name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* __glad_loader_library_c_ */
|
||||
static void* glad_glx_get_proc(const char *name, void *userptr) {
|
||||
return ((void* (*)(const char *name))userptr)(name);
|
||||
}
|
||||
|
||||
static void* _glx_handle;
|
||||
|
||||
int gladLoadGLXInternalLoader(Display *display, int screen) {
|
||||
static const char *NAMES[] = {
|
||||
#if defined __CYGWIN__
|
||||
"libGL-1.so",
|
||||
#endif
|
||||
"libGL.so.1",
|
||||
"libGL.so"
|
||||
};
|
||||
|
||||
int version = 0;
|
||||
int did_load = 0;
|
||||
void *userptrLoader;
|
||||
|
||||
if (_glx_handle == NULL) {
|
||||
_glx_handle = glad_get_dlopen_handle(NAMES, sizeof(NAMES) / sizeof(NAMES[0]));
|
||||
did_load = _glx_handle != NULL;
|
||||
}
|
||||
|
||||
if (_glx_handle != NULL) {
|
||||
userptrLoader = glad_dlsym_handle(_glx_handle, "glXGetProcAddressARB");
|
||||
if (userptrLoader != NULL) {
|
||||
version = gladLoadGLX(display, screen, (GLADloadproc) glad_glx_get_proc, userptrLoader);
|
||||
}
|
||||
|
||||
if (!version && did_load) {
|
||||
glad_close_dlopen_handle(_glx_handle);
|
||||
_glx_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
void gladUnloadGLXInternalLoader() {
|
||||
if (_glx_handle != NULL) {
|
||||
glad_close_dlopen_handle(_glx_handle);
|
||||
_glx_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* GLAD_GLX */
|
28
setup.py
28
setup.py
@ -22,7 +22,7 @@ CXX_FLAGS += '-DBT_USE_DOUBLE_PRECISION '
|
||||
CXX_FLAGS += '-DBT_ENABLE_ENET '
|
||||
CXX_FLAGS += '-DBT_ENABLE_CLSOCKET '
|
||||
CXX_FLAGS += '-DB3_DUMP_PYTHON_VERSION '
|
||||
|
||||
#CXX_FLAGS += '-DBT_USE_EGL ' # uncomment for EGL (old EGL versions fail)
|
||||
|
||||
|
||||
# libraries += [current_python]
|
||||
@ -386,28 +386,34 @@ sources = ["examples/pybullet/pybullet.c"]\
|
||||
+["examples/ThirdPartyLibs/Gwen/Renderers/OpenGL_DebugFont.cpp"]\
|
||||
|
||||
if _platform == "linux" or _platform == "linux2":
|
||||
libraries = ['dl','pthread']
|
||||
libraries += ['dl','pthread']
|
||||
CXX_FLAGS += '-D_LINUX '
|
||||
CXX_FLAGS += '-DGLEW_STATIC '
|
||||
CXX_FLAGS += '-DGLEW_INIT_OPENGL11_FUNCTIONS=1 '
|
||||
CXX_FLAGS += '-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1 '
|
||||
CXX_FLAGS += '-DDYNAMIC_LOAD_X11_FUNCTIONS '
|
||||
CXX_FLAGS += '-DHAS_SOCKLEN_T '
|
||||
CXX_FLAGS += '-fno-inline-functions-called-once'
|
||||
CXX_FLAGS += '-fno-inline-functions-called-once '
|
||||
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
|
||||
+["examples/ThirdPartyLibs/glad/glad.c"]\
|
||||
+["examples/ThirdPartyLibs/glad/glad_glx.c"]
|
||||
+["examples/ThirdPartyLibs/glad/gl.c"]\
|
||||
+["examples/ThirdPartyLibs/glad/glx.c"]
|
||||
include_dirs += ["examples/ThirdPartyLibs/optionalX11"]
|
||||
if 'BT_USE_EGL' in CXX_FLAGS:
|
||||
# linking with bullet's Glew libraries causes segfault
|
||||
# for some reason.
|
||||
sources += ['examples/ThirdPartyLibs/glad/egl.c']
|
||||
sources += ['examples/OpenGLWindow/EGLOpenGLWindow.cpp']
|
||||
|
||||
elif _platform == "win32":
|
||||
print("win32!")
|
||||
libraries = ['Ws2_32','Winmm','User32','Opengl32','kernel32','glu32','Gdi32','Comdlg32']
|
||||
libraries += ['Ws2_32','Winmm','User32','Opengl32','kernel32','glu32','Gdi32','Comdlg32']
|
||||
CXX_FLAGS += '-DWIN32 '
|
||||
CXX_FLAGS += '-DGLEW_STATIC '
|
||||
sources = sources + ["examples/ThirdPartyLibs/enet/win32.c"]\
|
||||
+["examples/OpenGLWindow/Win32Window.cpp"]\
|
||||
+["examples/OpenGLWindow/Win32OpenGLWindow.cpp"]\
|
||||
+["examples/ThirdPartyLibs/glad/glad.c"]
|
||||
+["examples/ThirdPartyLibs/glad/gl.c"]
|
||||
elif _platform == "darwin":
|
||||
print("darwin!")
|
||||
os.environ['LDFLAGS'] = '-framework Cocoa -framework OpenGL'
|
||||
@ -417,11 +423,11 @@ elif _platform == "darwin":
|
||||
# CXX_FLAGS += '-framework Cocoa '
|
||||
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||
+["examples/OpenGLWindow/MacOpenGLWindow.cpp"]\
|
||||
+["examples/ThirdPartyLibs/glad/glad.c"]\
|
||||
+["examples/ThirdPartyLibs/glad/gl.c"]\
|
||||
+["examples/OpenGLWindow/MacOpenGLWindowObjC.m"]
|
||||
else:
|
||||
print("bsd!")
|
||||
libraries = ['GL','GLEW','pthread']
|
||||
libraries += ['GL','GLEW','pthread']
|
||||
os.environ['LDFLAGS'] = '-L/usr/X11R6/lib'
|
||||
CXX_FLAGS += '-D_BSD '
|
||||
CXX_FLAGS += '-I/usr/X11R6/include '
|
||||
@ -429,7 +435,7 @@ else:
|
||||
CXX_FLAGS += '-fno-inline-functions-called-once'
|
||||
sources = ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
|
||||
+["examples/ThirdPartyLibs/glad/glad.c"]\
|
||||
+["examples/ThirdPartyLibs/glad/gl.c"]\
|
||||
+ sources
|
||||
|
||||
setup_py_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
@ -463,7 +469,7 @@ setup(
|
||||
license='zlib',
|
||||
platforms='any',
|
||||
keywords=['game development', 'virtual reality', 'physics simulation', 'robotics', 'collision detection', 'opengl'],
|
||||
ext_modules = [Extension("pybullet",
|
||||
ext_modules = [Extension("pybullet",
|
||||
sources = sources,
|
||||
libraries = libraries,
|
||||
extra_compile_args=CXX_FLAGS.split(),
|
||||
|
@ -356,7 +356,7 @@ int main()
|
||||
#ifndef _WIN32
|
||||
//we need glewExperimental on Linux
|
||||
#endif // _WIN32
|
||||
gladLoadGL();
|
||||
gladLoadGLInternalLoader();
|
||||
#endif
|
||||
#endif //B3_USE_GLFW
|
||||
//we ned to call glGetError twice, because of some Ubuntu/Intel/OpenGL issue
|
||||
|
Loading…
Reference in New Issue
Block a user