Convert local WindowsDisplay jclass reference to global.

This commit is contained in:
Ioannis Tsakpinis 2014-01-14 17:11:28 +02:00
parent 2976194124
commit d5d9f06160
3 changed files with 4 additions and 5 deletions

View File

@ -57,7 +57,7 @@ typedef struct {
* Register the LWJGL window class.
* Returns true for success, or false for failure
*/
extern bool registerWindow();
extern bool registerWindow(WNDPROC win_proc, LPCTSTR class_name);
extern bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat);

View File

@ -54,7 +54,7 @@ typedef struct {
* Register the LWJGL window class.
* Returns true for success, or false for failure
*/
extern bool registerWindow();
extern bool registerWindow(WNDPROC win_proc, LPCTSTR class_name);
//extern bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat);

View File

@ -114,7 +114,7 @@ static LRESULT CALLBACK lwjglWindowProc(HWND hWnd,
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setWindowProc(JNIEnv *env, jclass clazz, jobject method) {
windowsDisplayClass = clazz;
windowsDisplayClass = (*env)->NewGlobalRef(env, clazz);
javaWindowProc = (*env)->FromReflectedMethod(env, method);
}
@ -535,5 +535,4 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nTrackMouseEvent
tme.dwFlags = TME_LEAVE;
tme.hwndTrack = hwnd;
return TrackMouseEvent(&tme);
}
}