expose VM

This commit is contained in:
Brian Matzon 2004-05-31 12:39:03 +00:00
parent f75bb436c9
commit 9c8ac5d794
2 changed files with 11 additions and 0 deletions

View file

@ -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 @@ bool getBooleanProperty(JNIEnv *env, const char* propertyName) {
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) {
}

View file

@ -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)