Linux: renamed _glX* function pointers to lwjgl_glX* to avoid symbol clash problems discovered in mustang

This commit is contained in:
Elias Naur 2005-11-20 13:19:39 +00:00
parent 73314be1bb
commit b669751c73
6 changed files with 166 additions and 166 deletions

View File

@ -70,7 +70,7 @@ XVisualInfo *getVisualInfoFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info) {
GLXFBConfig *configs = getFBConfigFromPeerInfo(env, peer_info);
if (configs == NULL)
return NULL;
vis_info = _glXGetVisualFromFBConfig(peer_info->display, configs[0]);
vis_info = lwjgl_glXGetVisualFromFBConfig(peer_info->display, configs[0]);
if (vis_info == NULL)
throwException(env, "Could not get VisualInfo from GLX 1.3 config");
XFree(configs);
@ -81,7 +81,7 @@ XVisualInfo *getVisualInfoFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info) {
GLXFBConfig *getFBConfigFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info) {
int attribs[] = {GLX_FBCONFIG_ID, peer_info->config.glx13_config.config_id, None, None};
int num_elements;
GLXFBConfig *configs = _glXChooseFBConfig(peer_info->display, peer_info->screen, attribs, &num_elements);
GLXFBConfig *configs = lwjgl_glXChooseFBConfig(peer_info->display, peer_info->screen, attribs, &num_elements);
if (configs == NULL) {
throwException(env, "Could not find GLX 1.3 config from peer info");
return NULL;
@ -147,7 +147,7 @@ static GLXFBConfig *chooseVisualGLX13FromBPP(JNIEnv *env, Display *disp, int scr
}
putAttrib(&attrib_list, None); putAttrib(&attrib_list, None);
int num_formats = 0;
GLXFBConfig* configs = _glXChooseFBConfig(disp, screen, attrib_list.attribs, &num_formats);
GLXFBConfig* configs = lwjgl_glXChooseFBConfig(disp, screen, attrib_list.attribs, &num_formats);
if (num_formats > 0) {
return configs;
} else {
@ -208,7 +208,7 @@ static XVisualInfo *chooseVisualGLXFromBPP(JNIEnv *env, Display *disp, int scree
putAttrib(&attrib_list, GLX_SAMPLES_ARB); putAttrib(&attrib_list, samples);
}
putAttrib(&attrib_list, None);
return _glXChooseVisual(disp, screen, attrib_list.attribs);
return lwjgl_glXChooseVisual(disp, screen, attrib_list.attribs);
}
XVisualInfo *chooseVisualGLX(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, bool double_buffer) {
@ -230,15 +230,15 @@ static void dumpVisualInfo(JNIEnv *env, Display *display, GLXExtensions *extensi
int alpha, depth, stencil, r, g, b;
int sample_buffers = 0;
int samples = 0;
_glXGetConfig(display, vis_info, GLX_RED_SIZE, &r);
_glXGetConfig(display, vis_info, GLX_GREEN_SIZE, &g);
_glXGetConfig(display, vis_info, GLX_BLUE_SIZE, &b);
_glXGetConfig(display, vis_info, GLX_ALPHA_SIZE, &alpha);
_glXGetConfig(display, vis_info, GLX_DEPTH_SIZE, &depth);
_glXGetConfig(display, vis_info, GLX_STENCIL_SIZE, &stencil);
lwjgl_glXGetConfig(display, vis_info, GLX_RED_SIZE, &r);
lwjgl_glXGetConfig(display, vis_info, GLX_GREEN_SIZE, &g);
lwjgl_glXGetConfig(display, vis_info, GLX_BLUE_SIZE, &b);
lwjgl_glXGetConfig(display, vis_info, GLX_ALPHA_SIZE, &alpha);
lwjgl_glXGetConfig(display, vis_info, GLX_DEPTH_SIZE, &depth);
lwjgl_glXGetConfig(display, vis_info, GLX_STENCIL_SIZE, &stencil);
if (extension_flags->GLX_ARB_multisample) {
_glXGetConfig(display, vis_info, GLX_SAMPLE_BUFFERS_ARB, &sample_buffers);
_glXGetConfig(display, vis_info, GLX_SAMPLES_ARB, &samples);
lwjgl_glXGetConfig(display, vis_info, GLX_SAMPLE_BUFFERS_ARB, &sample_buffers);
lwjgl_glXGetConfig(display, vis_info, GLX_SAMPLES_ARB, &samples);
}
printfDebugJava(env, "Pixel format info: r = %d, g = %d, b = %d, a = %d, depth = %d, stencil = %d, sample buffers = %d, samples = %d", r, g, b, alpha, depth, stencil, sample_buffers, samples);
}
@ -272,14 +272,14 @@ bool initPeerInfo(JNIEnv *env, jobject peer_info_handle, Display *display, int s
return false;
}
if (isDebugEnabled()) {
XVisualInfo *vis_info = _glXGetVisualFromFBConfig(display, configs[0]);
XVisualInfo *vis_info = lwjgl_glXGetVisualFromFBConfig(display, configs[0]);
if (vis_info != NULL) {
dumpVisualInfo(env, display, &extension_flags, vis_info);
XFree(vis_info);
}
}
int config_id;
int result = _glXGetFBConfigAttrib(display, configs[0], GLX_FBCONFIG_ID, &config_id);
int result = lwjgl_glXGetFBConfigAttrib(display, configs[0], GLX_FBCONFIG_ID, &config_id);
XFree(configs);
if (result != Success) {
throwException(env, "Could not get GLX_FBCONFIG_ID from GLXFBConfig");

View File

@ -32,113 +32,113 @@
#include <dlfcn.h>
#include "extgl_glx.h"
glXGetFBConfigsPROC _glXGetFBConfigs = NULL;
glXChooseFBConfigPROC _glXChooseFBConfig = NULL;
glXGetFBConfigAttribPROC _glXGetFBConfigAttrib = NULL;
glXGetVisualFromFBConfigPROC _glXGetVisualFromFBConfig = NULL;
glXCreateWindowPROC _glXCreateWindow = NULL;
glXDestroyWindowPROC _glXDestroyWindow = NULL;
glXCreatePixmapPROC _glXCreatePixmap = NULL;
glXDestroyPixmapPROC _glXDestroyPixmap = NULL;
glXCreatePbufferPROC _glXCreatePbuffer = NULL;
glXDestroyPbufferPROC _glXDestroyPbuffer = NULL;
glXQueryDrawablePROC _glXQueryDrawable = NULL;
glXCreateNewContextPROC _glXCreateNewContext = NULL;
glXMakeContextCurrentPROC _glXMakeContextCurrent = NULL;
glXGetCurrentReadDrawablePROC _glXGetCurrentReadDrawable = NULL;
glXGetCurrentDisplayPROC _glXGetCurrentDisplay = NULL;
glXQueryContextPROC _glXQueryContext = NULL;
glXSelectEventPROC _glXSelectEvent = NULL;
glXGetSelectedEventPROC _glXGetSelectedEvent = NULL;
glXChooseVisualPROC _glXChooseVisual = NULL;
glXCopyContextPROC _glXCopyContext = NULL;
glXCreateContextPROC _glXCreateContext = NULL;
glXCreateGLXPixmapPROC _glXCreateGLXPixmap = NULL;
glXDestroyContextPROC _glXDestroyContext = NULL;
glXDestroyGLXPixmapPROC _glXDestroyGLXPixmap = NULL;
glXGetConfigPROC _glXGetConfig = NULL;
glXGetCurrentContextPROC _glXGetCurrentContext = NULL;
glXGetCurrentDrawablePROC _glXGetCurrentDrawable = NULL;
glXIsDirectPROC _glXIsDirect = NULL;
glXMakeCurrentPROC _glXMakeCurrent = NULL;
glXQueryExtensionPROC _glXQueryExtension = NULL;
glXQueryVersionPROC _glXQueryVersion = NULL;
glXSwapBuffersPROC _glXSwapBuffers = NULL;
glXUseXFontPROC _glXUseXFont = NULL;
glXWaitGLPROC _glXWaitGL = NULL;
glXWaitXPROC _glXWaitX = NULL;
glXGetClientStringPROC _glXGetClientString = NULL;
glXQueryServerStringPROC _glXQueryServerString = NULL;
glXQueryExtensionsStringPROC _glXQueryExtensionsString = NULL;
glXGetFBConfigsPROC lwjgl_glXGetFBConfigs = NULL;
glXChooseFBConfigPROC lwjgl_glXChooseFBConfig = NULL;
glXGetFBConfigAttribPROC lwjgl_glXGetFBConfigAttrib = NULL;
glXGetVisualFromFBConfigPROC lwjgl_glXGetVisualFromFBConfig = NULL;
glXCreateWindowPROC lwjgl_glXCreateWindow = NULL;
glXDestroyWindowPROC lwjgl_glXDestroyWindow = NULL;
glXCreatePixmapPROC lwjgl_glXCreatePixmap = NULL;
glXDestroyPixmapPROC lwjgl_glXDestroyPixmap = NULL;
glXCreatePbufferPROC lwjgl_glXCreatePbuffer = NULL;
glXDestroyPbufferPROC lwjgl_glXDestroyPbuffer = NULL;
glXQueryDrawablePROC lwjgl_glXQueryDrawable = NULL;
glXCreateNewContextPROC lwjgl_glXCreateNewContext = NULL;
glXMakeContextCurrentPROC lwjgl_glXMakeContextCurrent = NULL;
glXGetCurrentReadDrawablePROC lwjgl_glXGetCurrentReadDrawable = NULL;
glXGetCurrentDisplayPROC lwjgl_glXGetCurrentDisplay = NULL;
glXQueryContextPROC lwjgl_glXQueryContext = NULL;
glXSelectEventPROC lwjgl_glXSelectEvent = NULL;
glXGetSelectedEventPROC lwjgl_glXGetSelectedEvent = NULL;
glXChooseVisualPROC lwjgl_glXChooseVisual = NULL;
glXCopyContextPROC lwjgl_glXCopyContext = NULL;
glXCreateContextPROC lwjgl_glXCreateContext = NULL;
glXCreateGLXPixmapPROC lwjgl_glXCreateGLXPixmap = NULL;
glXDestroyContextPROC lwjgl_glXDestroyContext = NULL;
glXDestroyGLXPixmapPROC lwjgl_glXDestroyGLXPixmap = NULL;
glXGetConfigPROC lwjgl_glXGetConfig = NULL;
glXGetCurrentContextPROC lwjgl_glXGetCurrentContext = NULL;
glXGetCurrentDrawablePROC lwjgl_glXGetCurrentDrawable = NULL;
glXIsDirectPROC lwjgl_glXIsDirect = NULL;
glXMakeCurrentPROC lwjgl_glXMakeCurrent = NULL;
glXQueryExtensionPROC lwjgl_glXQueryExtension = NULL;
glXQueryVersionPROC lwjgl_glXQueryVersion = NULL;
glXSwapBuffersPROC lwjgl_glXSwapBuffers = NULL;
glXUseXFontPROC lwjgl_glXUseXFont = NULL;
glXWaitGLPROC lwjgl_glXWaitGL = NULL;
glXWaitXPROC lwjgl_glXWaitX = NULL;
glXGetClientStringPROC lwjgl_glXGetClientString = NULL;
glXQueryServerStringPROC lwjgl_glXQueryServerString = NULL;
export glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString = NULL;
/* GLX_SGI_swap_control */
glXSwapIntervalSGIPROC _glXSwapIntervalSGI = NULL;
glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI = NULL;
static void * lib_gl_handle = NULL;
typedef void * (APIENTRY * glXGetProcAddressARBPROC) (const GLubyte *procName);
static glXGetProcAddressARBPROC _glXGetProcAddressARB;
static glXGetProcAddressARBPROC lwjgl_glXGetProcAddressARB;
static GLXExtensions symbols_flags;
/** returns true if the extention is available */
static bool GLXQueryExtension(Display *disp, int screen, const char *name) {
const GLubyte *exts = (const GLubyte *)_glXQueryExtensionsString(disp, screen);
const GLubyte *exts = (const GLubyte *)lwjgl_glXQueryExtensionsString(disp, screen);
return extgl_QueryExtension(exts, name);
}
static void extgl_InitGLX13() {
ExtFunction functions[] = {
{"glXGetFBConfigs", (void*)&_glXGetFBConfigs},
{"glXChooseFBConfig", (void*)&_glXChooseFBConfig},
{"glXGetFBConfigAttrib", (void*)&_glXGetFBConfigAttrib},
{"glXGetVisualFromFBConfig", (void*)&_glXGetVisualFromFBConfig},
{"glXCreateWindow", (void*)&_glXCreateWindow},
{"glXDestroyWindow", (void*)&_glXDestroyWindow},
{"glXCreatePixmap", (void*)&_glXCreatePixmap},
{"glXDestroyPixmap", (void*)&_glXDestroyPixmap},
{"glXCreatePbuffer", (void*)&_glXCreatePbuffer},
{"glXDestroyPbuffer", (void*)&_glXDestroyPbuffer},
{"glXQueryDrawable", (void*)&_glXQueryDrawable},
{"glXCreateNewContext", (void*)&_glXCreateNewContext},
{"glXMakeContextCurrent", (void*)&_glXMakeContextCurrent},
{"glXGetCurrentReadDrawable", (void*)&_glXGetCurrentReadDrawable},
{"glXGetCurrentDisplay", (void*)&_glXGetCurrentDisplay},
{"glXQueryContext", (void*)&_glXQueryContext},
{"glXSelectEvent", (void*)&_glXSelectEvent},
{"glXGetSelectedEvent", (void*)&_glXGetSelectedEvent}};
{"glXGetFBConfigs", (void*)&lwjgl_glXGetFBConfigs},
{"glXChooseFBConfig", (void*)&lwjgl_glXChooseFBConfig},
{"glXGetFBConfigAttrib", (void*)&lwjgl_glXGetFBConfigAttrib},
{"glXGetVisualFromFBConfig", (void*)&lwjgl_glXGetVisualFromFBConfig},
{"glXCreateWindow", (void*)&lwjgl_glXCreateWindow},
{"glXDestroyWindow", (void*)&lwjgl_glXDestroyWindow},
{"glXCreatePixmap", (void*)&lwjgl_glXCreatePixmap},
{"glXDestroyPixmap", (void*)&lwjgl_glXDestroyPixmap},
{"glXCreatePbuffer", (void*)&lwjgl_glXCreatePbuffer},
{"glXDestroyPbuffer", (void*)&lwjgl_glXDestroyPbuffer},
{"glXQueryDrawable", (void*)&lwjgl_glXQueryDrawable},
{"glXCreateNewContext", (void*)&lwjgl_glXCreateNewContext},
{"glXMakeContextCurrent", (void*)&lwjgl_glXMakeContextCurrent},
{"glXGetCurrentReadDrawable", (void*)&lwjgl_glXGetCurrentReadDrawable},
{"glXGetCurrentDisplay", (void*)&lwjgl_glXGetCurrentDisplay},
{"glXQueryContext", (void*)&lwjgl_glXQueryContext},
{"glXSelectEvent", (void*)&lwjgl_glXSelectEvent},
{"glXGetSelectedEvent", (void*)&lwjgl_glXGetSelectedEvent}};
symbols_flags.GLX13 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
}
static void extgl_InitGLX12(void) {
ExtFunction functions[] = {
{"glXChooseVisual", (void*)&_glXChooseVisual},
{"glXCopyContext", (void*)&_glXCopyContext},
{"glXCreateContext", (void*)&_glXCreateContext},
{"glXCreateGLXPixmap", (void*)&_glXCreateGLXPixmap},
{"glXDestroyContext", (void*)&_glXDestroyContext},
{"glXDestroyGLXPixmap", (void*)&_glXDestroyGLXPixmap},
{"glXGetConfig", (void*)&_glXGetConfig},
{"glXGetCurrentContext", (void*)&_glXGetCurrentContext},
{"glXGetCurrentDrawable", (void*)&_glXGetCurrentDrawable},
{"glXIsDirect", (void*)&_glXIsDirect},
{"glXMakeCurrent", (void*)&_glXMakeCurrent},
{"glXQueryExtension", (void*)&_glXQueryExtension},
{"glXQueryVersion", (void*)&_glXQueryVersion},
{"glXSwapBuffers", (void*)&_glXSwapBuffers},
{"glXUseXFont", (void*)&_glXUseXFont},
{"glXWaitGL", (void*)&_glXWaitGL},
{"glXWaitX", (void*)&_glXWaitX},
{"glXGetClientString", (void*)&_glXGetClientString},
{"glXQueryServerString", (void*)&_glXQueryServerString},
{"glXQueryExtensionsString", (void*)&_glXQueryExtensionsString}};
{"glXChooseVisual", (void*)&lwjgl_glXChooseVisual},
{"glXCopyContext", (void*)&lwjgl_glXCopyContext},
{"glXCreateContext", (void*)&lwjgl_glXCreateContext},
{"glXCreateGLXPixmap", (void*)&lwjgl_glXCreateGLXPixmap},
{"glXDestroyContext", (void*)&lwjgl_glXDestroyContext},
{"glXDestroyGLXPixmap", (void*)&lwjgl_glXDestroyGLXPixmap},
{"glXGetConfig", (void*)&lwjgl_glXGetConfig},
{"glXGetCurrentContext", (void*)&lwjgl_glXGetCurrentContext},
{"glXGetCurrentDrawable", (void*)&lwjgl_glXGetCurrentDrawable},
{"glXIsDirect", (void*)&lwjgl_glXIsDirect},
{"glXMakeCurrent", (void*)&lwjgl_glXMakeCurrent},
{"glXQueryExtension", (void*)&lwjgl_glXQueryExtension},
{"glXQueryVersion", (void*)&lwjgl_glXQueryVersion},
{"glXSwapBuffers", (void*)&lwjgl_glXSwapBuffers},
{"glXUseXFont", (void*)&lwjgl_glXUseXFont},
{"glXWaitGL", (void*)&lwjgl_glXWaitGL},
{"glXWaitX", (void*)&lwjgl_glXWaitX},
{"glXGetClientString", (void*)&lwjgl_glXGetClientString},
{"glXQueryServerString", (void*)&lwjgl_glXQueryServerString},
{"glXQueryExtensionsString", (void*)&lwjgl_glXQueryExtensionsString}};
symbols_flags.GLX12 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
}
static void extgl_InitGLXSGISwapControl() {
ExtFunction functions[] = {
{"glXSwapIntervalSGI", (void*)&_glXSwapIntervalSGI}};
{"glXSwapIntervalSGI", (void*)&lwjgl_glXSwapIntervalSGI}};
symbols_flags.GLX_SGI_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
}
@ -161,8 +161,8 @@ bool extgl_Open(JNIEnv *env) {
throwException(env, buffer);
return false;
}
_glXGetProcAddressARB = (glXGetProcAddressARBPROC)dlsym(lib_gl_handle, "glXGetProcAddressARB");
if (_glXGetProcAddressARB == NULL) {
lwjgl_glXGetProcAddressARB = (glXGetProcAddressARBPROC)dlsym(lib_gl_handle, "glXGetProcAddressARB");
if (lwjgl_glXGetProcAddressARB == NULL) {
extgl_Close();
throwException(env, "Could not get address of glXGetProcAddressARB");
return false;
@ -177,7 +177,7 @@ bool extgl_Open(JNIEnv *env) {
}
void *extgl_GetProcAddress(const char *name) {
void *t = (void*)_glXGetProcAddressARB((const GLubyte*)name);
void *t = (void*)lwjgl_glXGetProcAddressARB((const GLubyte*)name);
if (t == NULL) {
t = dlsym(lib_gl_handle, name);
if (t == NULL) {
@ -198,7 +198,7 @@ bool extgl_InitGLX(Display *disp, int screen, GLXExtensions *extension_flags) {
// Check GLX 1.2 symbols available
if (!symbols_flags.GLX12)
return false;
if (_glXQueryVersion(disp, &major, &minor) != True)
if (lwjgl_glXQueryVersion(disp, &major, &minor) != True)
return false;
bool glx12 = major > 1 || (major == 1 && minor >= 2);
// Check GLX 1.2 version

View File

@ -37,7 +37,7 @@
#include "extgl.h"
/*
* Names for attributes to _glXGetConfig.
* Names for attributes to lwjgl_glXGetConfig.
*/
#define GLX_USE_GL 1 /* support GLX rendering */
#define GLX_BUFFER_SIZE 2 /* depth of the color buffer */
@ -91,7 +91,7 @@
#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
/*
* Error return values from _glXGetConfig. Success is indicated by
* Error return values from lwjgl_glXGetConfig. Success is indicated by
* a value of 0.
*/
#define GLX_BAD_SCREEN 1 /* screen # is bad */
@ -106,7 +106,7 @@
/* FBConfig attribute values */
/*
* Generic "don't care" value for _glX ChooseFBConfig attributes (except
* Generic "don't care" value for lwjgl_glX ChooseFBConfig attributes (except
* GLX_LEVEL).
*/
#define GLX_DONT_CARE 0xFFFFFFFF
@ -143,7 +143,7 @@
#define GLX_TRANSPARENT_RGB 0x8008
#define GLX_TRANSPARENT_INDEX 0x8009
/* _glXCreateGLXPbuffer attributes */
/* lwjgl_glXCreateGLXPbuffer attributes */
#define GLX_PRESERVED_CONTENTS 0x801B
#define GLX_LARGEST_PBUFFER 0x801C
#define GLX_PBUFFER_HEIGHT 0x8040 /* New for GLX 1.3 */
@ -151,7 +151,7 @@
#define GLX_PRESERVED_CONTENTS_SGIX GLX_PRESERVED_CONTENTS
#define GLX_LARGEST_PBUFFER_SGIX GLX_LARGEST_PBUFFER
/* _glXQueryGLXPBuffer attributes */
/* lwjgl_glXQueryGLXPBuffer attributes */
#define GLX_WIDTH 0x801D
#define GLX_HEIGHT 0x801E
#define GLX_EVENT_MASK 0x801F
@ -159,18 +159,18 @@
#define GLX_HEIGHT_SGIX GLX_HEIGHT
#define GLX_EVENT_MASK_SGIX GLX_EVENT_MASK
/* _glXCreateNewContext render_type attribute values */
/* lwjgl_glXCreateNewContext render_type attribute values */
#define GLX_RGBA_TYPE 0x8014
#define GLX_COLOR_INDEX_TYPE 0x8015
#define GLX_RGBA_TYPE_SGIX GLX_RGBA_TYPE
#define GLX_COLOR_INDEX_TYPE_SGIX GLX_COLOR_INDEX_TYPE
/* _glXQueryContext attributes */
/* lwjgl_glXQueryContext attributes */
/* #define GLX_FBCONFIG_ID 0x8013 */
/* #define GLX_RENDER_TYPE 0x8011 */
#define GLX_SCREEN 0x800C
/* _glXSelectEvent event mask bits */
/* lwjgl_glXSelectEvent event mask bits */
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
#define GLX_PBUFFER_CLOBBER_MASK_SGIX GLX_PBUFFER_CLOBBER_MASK
@ -205,8 +205,8 @@
#define GLX_ACCUM_BUFFER_BIT_SGIX GLX_ACCUM_BUFFER_BIT
/*
* Extension return values from _glXGetConfig. These are also
* accepted as parameter values for _glXChooseVisual.
* Extension return values from lwjgl_glXGetConfig. These are also
* accepted as parameter values for lwjgl_glXChooseVisual.
*/
#define GLX_X_VISUAL_TYPE_EXT 0x22 /* visual_info extension type */
@ -236,14 +236,14 @@
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
/*
* Names for attributes to _glXGetClientString.
* Names for attributes to lwjgl_glXGetClientString.
*/
#define GLX_VENDOR 0x1
#define GLX_VERSION 0x2
#define GLX_EXTENSIONS 0x3
/*
* Names for attributes to _glXQueryContextInfoEXT.
* Names for attributes to lwjgl_glXQueryContextInfoEXT.
*/
#define GLX_SHARE_CONTEXT_EXT 0x800A /* id of share context */
#define GLX_VISUAL_ID_EXT 0x800B /* id of context's visual */
@ -322,47 +322,47 @@ typedef struct {
} GLXExtensions;
/* Add _ to global symbols to avoid symbol clash with the OpenGL library */
extern glXGetFBConfigsPROC _glXGetFBConfigs;
extern glXChooseFBConfigPROC _glXChooseFBConfig;
extern glXGetFBConfigAttribPROC _glXGetFBConfigAttrib;
extern glXGetVisualFromFBConfigPROC _glXGetVisualFromFBConfig;
extern glXCreateWindowPROC _glXCreateWindow;
extern glXDestroyWindowPROC _glXDestroyWindow;
extern glXCreatePixmapPROC _glXCreatePixmap;
extern glXDestroyPixmapPROC _glXDestroyPixmap;
extern glXCreatePbufferPROC _glXCreatePbuffer;
extern glXDestroyPbufferPROC _glXDestroyPbuffer;
extern glXQueryDrawablePROC _glXQueryDrawable;
extern glXCreateNewContextPROC _glXCreateNewContext;
extern glXMakeContextCurrentPROC _glXMakeContextCurrent;
extern glXGetCurrentReadDrawablePROC _glXGetCurrentReadDrawable;
extern glXGetCurrentDisplayPROC _glXGetCurrentDisplay;
extern glXQueryContextPROC _glXQueryContext;
extern glXSelectEventPROC _glXSelectEvent;
extern glXGetSelectedEventPROC _glXGetSelectedEvent;
extern glXGetFBConfigsPROC lwjgl_glXGetFBConfigs;
extern glXChooseFBConfigPROC lwjgl_glXChooseFBConfig;
extern glXGetFBConfigAttribPROC lwjgl_glXGetFBConfigAttrib;
extern glXGetVisualFromFBConfigPROC lwjgl_glXGetVisualFromFBConfig;
extern glXCreateWindowPROC lwjgl_glXCreateWindow;
extern glXDestroyWindowPROC lwjgl_glXDestroyWindow;
extern glXCreatePixmapPROC lwjgl_glXCreatePixmap;
extern glXDestroyPixmapPROC lwjgl_glXDestroyPixmap;
extern glXCreatePbufferPROC lwjgl_glXCreatePbuffer;
extern glXDestroyPbufferPROC lwjgl_glXDestroyPbuffer;
extern glXQueryDrawablePROC lwjgl_glXQueryDrawable;
extern glXCreateNewContextPROC lwjgl_glXCreateNewContext;
extern glXMakeContextCurrentPROC lwjgl_glXMakeContextCurrent;
extern glXGetCurrentReadDrawablePROC lwjgl_glXGetCurrentReadDrawable;
extern glXGetCurrentDisplayPROC lwjgl_glXGetCurrentDisplay;
extern glXQueryContextPROC lwjgl_glXQueryContext;
extern glXSelectEventPROC lwjgl_glXSelectEvent;
extern glXGetSelectedEventPROC lwjgl_glXGetSelectedEvent;
extern glXChooseVisualPROC _glXChooseVisual;
extern glXCopyContextPROC _glXCopyContext;
extern glXCreateContextPROC _glXCreateContext;
extern glXCreateGLXPixmapPROC _glXCreateGLXPixmap;
extern glXDestroyContextPROC _glXDestroyContext;
extern glXDestroyGLXPixmapPROC _glXDestroyGLXPixmap;
extern glXGetConfigPROC _glXGetConfig;
extern glXGetCurrentContextPROC _glXGetCurrentContext;
extern glXGetCurrentDrawablePROC _glXGetCurrentDrawable;
extern glXIsDirectPROC _glXIsDirect;
extern glXMakeCurrentPROC _glXMakeCurrent;
extern glXQueryExtensionPROC _glXQueryExtension;
extern glXQueryVersionPROC _glXQueryVersion;
extern glXSwapBuffersPROC _glXSwapBuffers;
extern glXUseXFontPROC _glXUseXFont;
extern glXWaitGLPROC _glXWaitGL;
extern glXWaitXPROC _glXWaitX;
extern glXGetClientStringPROC _glXGetClientString;
extern glXQueryServerStringPROC _glXQueryServerString;
extern glXQueryExtensionsStringPROC _glXQueryExtensionsString;
extern glXChooseVisualPROC lwjgl_glXChooseVisual;
extern glXCopyContextPROC lwjgl_glXCopyContext;
extern glXCreateContextPROC lwjgl_glXCreateContext;
extern glXCreateGLXPixmapPROC lwjgl_glXCreateGLXPixmap;
extern glXDestroyContextPROC lwjgl_glXDestroyContext;
extern glXDestroyGLXPixmapPROC lwjgl_glXDestroyGLXPixmap;
extern glXGetConfigPROC lwjgl_glXGetConfig;
extern glXGetCurrentContextPROC lwjgl_glXGetCurrentContext;
extern glXGetCurrentDrawablePROC lwjgl_glXGetCurrentDrawable;
extern glXIsDirectPROC lwjgl_glXIsDirect;
extern glXMakeCurrentPROC lwjgl_glXMakeCurrent;
extern glXQueryExtensionPROC lwjgl_glXQueryExtension;
extern glXQueryVersionPROC lwjgl_glXQueryVersion;
extern glXSwapBuffersPROC lwjgl_glXSwapBuffers;
extern glXUseXFontPROC lwjgl_glXUseXFont;
extern glXWaitGLPROC lwjgl_glXWaitGL;
extern glXWaitXPROC lwjgl_glXWaitX;
extern glXGetClientStringPROC lwjgl_glXGetClientString;
extern glXQueryServerStringPROC lwjgl_glXQueryServerString;
extern glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString;
extern glXSwapIntervalSGIPROC _glXSwapIntervalSGI;
extern glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI;
extern bool extgl_InitGLX(Display *disp, int screen, GLXExtensions *extension_flags);

View File

@ -331,7 +331,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetTitle(JNIEnv * env
static void destroyWindow(JNIEnv *env) {
if (glx_window != None) {
_glXDestroyWindow(getDisplay(), glx_window);
lwjgl_glXDestroyWindow(getDisplay(), glx_window);
glx_window = None;
}
XDestroyWindow(getDisplay(), current_win);
@ -518,11 +518,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *
return;
}
if (peer_info->glx13) {
glx_window = _glXCreateWindow(getDisplay(), *fb_config, getCurrentWindow(), NULL);
glx_window = lwjgl_glXCreateWindow(getDisplay(), *fb_config, getCurrentWindow(), NULL);
XFree(fb_config);
}
if (!checkXError(env, getDisplay())) {
_glXDestroyWindow(getDisplay(), glx_window);
lwjgl_glXDestroyWindow(getDisplay(), glx_window);
destroyWindow(env);
}
}

View File

@ -58,8 +58,8 @@ static bool checkContext(JNIEnv *env, Display *display, GLXContext context) {
return false;
}
jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
if (!allow_software_acceleration && _glXIsDirect(display, context) == False) {
_glXDestroyContext(display, context);
if (!allow_software_acceleration && lwjgl_glXIsDirect(display, context) == False) {
lwjgl_glXDestroyContext(display, context);
throwException(env, "Could not create a direct GLX context");
return false;
}
@ -70,7 +70,7 @@ static void createContextGLX13(JNIEnv *env, X11PeerInfo *peer_info, X11Context *
GLXFBConfig *config = getFBConfigFromPeerInfo(env, peer_info);
if (config == NULL)
return;
GLXContext context = _glXCreateNewContext(peer_info->display, *config, GLX_RGBA_TYPE, shared_context, True);
GLXContext context = lwjgl_glXCreateNewContext(peer_info->display, *config, GLX_RGBA_TYPE, shared_context, True);
XFree(config);
if (!checkContext(env, peer_info->display, context))
return;
@ -81,7 +81,7 @@ static void createContextGLX(JNIEnv *env, X11PeerInfo *peer_info, X11Context *co
XVisualInfo *vis_info = getVisualInfoFromPeerInfo(env, peer_info);
if (vis_info == NULL)
return;
GLXContext context = _glXCreateContext(peer_info->display, vis_info, shared_context, True);
GLXContext context = lwjgl_glXCreateContext(peer_info->display, vis_info, shared_context, True);
XFree(vis_info);
if (!checkContext(env, peer_info->display, context))
return;
@ -94,7 +94,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSetVSyn
X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
if (context_info->extension_flags.GLX_SGI_swap_control) {
int interval = sync == JNI_TRUE ? 1 : 0;
_glXSwapIntervalSGI(interval);
lwjgl_glXSwapIntervalSGI(interval);
}
}
@ -130,7 +130,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nDestroy
(JNIEnv *env, jclass clazz, jobject peer_handle, jobject context_handle) {
X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle);
X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
_glXDestroyContext(peer_info->display, context_info->context);
lwjgl_glXDestroyContext(peer_info->display, context_info->context);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nReleaseCurrentContext
@ -138,9 +138,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nRelease
X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
Bool result;
if (peer_info->glx13) {
result = _glXMakeContextCurrent(peer_info->display, None, None, NULL);
result = lwjgl_glXMakeContextCurrent(peer_info->display, None, None, NULL);
} else {
result = _glXMakeCurrent(peer_info->display, None, NULL);
result = lwjgl_glXMakeCurrent(peer_info->display, None, NULL);
}
if (!result)
throwException(env, "Could not release current context");
@ -152,9 +152,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nMakeCur
X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
Bool result;
if (peer_info->glx13) {
result = _glXMakeContextCurrent(peer_info->display, peer_info->drawable, peer_info->drawable, context_info->context);
result = lwjgl_glXMakeContextCurrent(peer_info->display, peer_info->drawable, peer_info->drawable, context_info->context);
} else {
result = _glXMakeCurrent(peer_info->display, peer_info->drawable, context_info->context);
result = lwjgl_glXMakeCurrent(peer_info->display, peer_info->drawable, context_info->context);
}
if (!result)
throwException(env, "Could not make context current");
@ -163,11 +163,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nMakeCur
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nIsCurrent
(JNIEnv *env, jclass clazz, jobject context_handle) {
X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
return context_info->context == _glXGetCurrentContext();
return context_info->context == lwjgl_glXGetCurrentContext();
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSwapBuffers
(JNIEnv *env, jclass clazz, jobject peer_info_handle) {
X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
_glXSwapBuffers(peer_info->display, peer_info->drawable);
lwjgl_glXSwapBuffers(peer_info->display, peer_info->drawable);
}

View File

@ -76,7 +76,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nInitHandle
X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
GLXFBConfig *config = getFBConfigFromPeerInfo(env, peer_info);
if (config != NULL) {
GLXPbuffer buffer = _glXCreatePbuffer(peer_info->display, *config, buffer_attribs);
GLXPbuffer buffer = lwjgl_glXCreatePbuffer(peer_info->display, *config, buffer_attribs);
XFree(config);
peer_info->drawable = buffer;
}
@ -85,5 +85,5 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nInitHandle
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nDestroy
(JNIEnv *env, jclass clazz, jobject peer_info_handle) {
X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
_glXDestroyPbuffer(peer_info->display, peer_info->drawable);
lwjgl_glXDestroyPbuffer(peer_info->display, peer_info->drawable);
}