Make sure the GL11 native stubs are unloaded too.

Throw exception when wglMakeCurrent fails
This commit is contained in:
Elias Naur 2004-07-04 08:39:09 +00:00
parent 15934fd6e7
commit 8585d8b2a5
3 changed files with 10 additions and 4 deletions

View File

@ -330,8 +330,11 @@ public final class GLContext {
private static void unloadStubs() {
Iterator exts_it = exts.keySet().iterator();
while (exts_it.hasNext())
resetNativeStubs((Class)exts_it.next());
while (exts_it.hasNext()) {
Class ext_class = (Class)exts_it.next();
resetNativeStubs(ext_class);
}
resetNativeStubs(org.lwjgl.opengl.GL11.class);
}
/**

View File

@ -561,7 +561,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nSetVSyncEnabled
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nMakeCurrent
(JNIEnv *env, jclass clazz)
{
wglMakeCurrent(hdc, hglrc);
BOOL result = wglMakeCurrent(hdc, hglrc);
if (!result)
throwException(env, "Could not make display context current");
}
/*

View File

@ -174,7 +174,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nMakeCurrent
(JNIEnv *env, jclass clazz, jint handle)
{
PbufferInfo *Pbuffer_info = (PbufferInfo *)handle;
wglMakeCurrent(Pbuffer_info->Pbuffer_dc, Pbuffer_info->Pbuffer_context);
if (!wglMakeCurrent(Pbuffer_info->Pbuffer_dc, Pbuffer_info->Pbuffer_context))
throwException(env, "Could not make pbuffer context current");
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy