|
From: Brian M. <ma...@us...> - 2004-05-31 12:39:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24994 Modified Files: common_tools.cpp common_tools.h Log Message: expose VM Index: common_tools.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- common_tools.cpp 23 May 2004 18:57:02 -0000 1.20 +++ common_tools.cpp 31 May 2004 12:39:03 -0000 1.21 @@ -42,6 +42,7 @@ static bool debug = false; static const char* VERSION = "0.9pre"; +JavaVM *jvm; jstring getVersionString(JNIEnv *env) { return env->NewStringUTF(VERSION); @@ -207,3 +208,10 @@ jmethodID getBoolean = env->GetStaticMethodID(booleanClass, "getBoolean", "(Ljava/lang/String;)Z"); return env->CallStaticBooleanMethod(booleanClass, getBoolean, property)? true : false; } + +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { + jvm = vm; + return JNI_VERSION_1_4; +} +JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) { +} \ No newline at end of file Index: common_tools.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- common_tools.h 23 May 2004 13:50:08 -0000 1.15 +++ common_tools.h 31 May 2004 12:39:03 -0000 1.16 @@ -43,6 +43,9 @@ #include <jni.h> #include "org_lwjgl_Sys.h" +// shared VM instance +extern JavaVM *jvm; + // Must be x * max_event_size + 1 #define EVENT_BUFFER_SIZE (25 * 4 + 1) |