Moved init of glXGetProcAddress to extgl_Open
This commit is contained in:
parent
02d8edf1e2
commit
4faac55de3
|
@ -1064,9 +1064,6 @@ bool extgl_InitGLX(JNIEnv *env, Display *disp, int screen)
|
||||||
int major, minor;
|
int major, minor;
|
||||||
/* Assume glx ver >= 1.2 */
|
/* Assume glx ver >= 1.2 */
|
||||||
extgl_Extensions.GLX12 = true;
|
extgl_Extensions.GLX12 = true;
|
||||||
glXGetProcAddressARB = (glXGetProcAddressARBPROC) dlsym(lib_gl_handle, "glXGetProcAddressARB");
|
|
||||||
if (glXGetProcAddressARB == NULL)
|
|
||||||
return false;
|
|
||||||
if (!extgl_InitGLX12())
|
if (!extgl_InitGLX12())
|
||||||
return false;
|
return false;
|
||||||
extgl_InitGLXSupportedExtensions(env, disp, screen);
|
extgl_InitGLXSupportedExtensions(env, disp, screen);
|
||||||
|
@ -1273,10 +1270,6 @@ extern void extgl_InitOpenGL1_5(JNIEnv *env, jobject ext_set);
|
||||||
/* extgl_Init the extensions and load all the functions */
|
/* extgl_Init the extensions and load all the functions */
|
||||||
bool extgl_Initialize(JNIEnv *env, jobject ext_set)
|
bool extgl_Initialize(JNIEnv *env, jobject ext_set)
|
||||||
{
|
{
|
||||||
if (!extgl_Open()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
extgl_error = false;
|
extgl_error = false;
|
||||||
extgl_InitOpenGL1_1();
|
extgl_InitOpenGL1_1();
|
||||||
if (extgl_error)
|
if (extgl_error)
|
||||||
|
@ -1377,6 +1370,11 @@ bool extgl_Open()
|
||||||
printfDebug("Error loading libGL.so.1: %s\n", dlerror());
|
printfDebug("Error loading libGL.so.1: %s\n", dlerror());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
glXGetProcAddressARB = (glXGetProcAddressARBPROC) dlsym(lib_gl_handle, "glXGetProcAddressARB");
|
||||||
|
if (glXGetProcAddressARB == NULL) {
|
||||||
|
extgl_Close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,12 @@
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_init
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_init
|
||||||
(JNIEnv * env, jclass clazz, jobject exts)
|
(JNIEnv * env, jclass clazz, jobject exts)
|
||||||
{
|
{
|
||||||
|
if (!extgl_Open()) {
|
||||||
|
throwException(env, "Failed to load OpenGL library");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!extgl_Initialize(env, exts)) {
|
if (!extgl_Initialize(env, exts)) {
|
||||||
throwException(env, "Failed to initialize GL extensions");
|
throwException(env, "Failed to initialize GL extensions");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue