From 4def20c892ea3963809002bba7c39336eea2d120 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 6 Jan 2005 14:03:48 +0000 Subject: [PATCH] Linux: Moved trivial methods from native to java --- src/java/org/lwjgl/opengl/LinuxDisplay.java | 16 +++++++++++++--- src/native/linux/org_lwjgl_input_Mouse.c | 4 ---- src/native/linux/org_lwjgl_opengl_Display.c | 10 +--------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/java/org/lwjgl/opengl/LinuxDisplay.java b/src/java/org/lwjgl/opengl/LinuxDisplay.java index 6e236ec6..4bca9b9e 100644 --- a/src/java/org/lwjgl/opengl/LinuxDisplay.java +++ b/src/java/org/lwjgl/opengl/LinuxDisplay.java @@ -55,8 +55,15 @@ final class LinuxDisplay implements DisplayImplementation { public native void resetDisplayMode(); public native int getGammaRampLength(); public native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException; - public native String getAdapter(); - public native String getVersion(); + + public String getAdapter() { + return null; + } + + public String getVersion() { + return null; + } + public native DisplayMode init(); public native void setTitle(String title); public native boolean isCloseRequested(); @@ -72,7 +79,10 @@ final class LinuxDisplay implements DisplayImplementation { public native void reshape(int x, int y, int width, int height); public native DisplayMode[] getAvailableDisplayModes(); /* Mouse */ - public native boolean hasWheel(); + public boolean hasWheel() { + return true; + } + public native int getButtonCount(); public native void createMouse(); public native void destroyMouse(); diff --git a/src/native/linux/org_lwjgl_input_Mouse.c b/src/native/linux/org_lwjgl_input_Mouse.c index 407219b0..d1d0e7e8 100644 --- a/src/native/linux/org_lwjgl_input_Mouse.c +++ b/src/native/linux/org_lwjgl_input_Mouse.c @@ -236,10 +236,6 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getMaxCursorSize return width_return > height_return ? height_return : width_return; } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_hasWheel(JNIEnv *env , jobject this) { - return JNI_TRUE; -} - JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getButtonCount(JNIEnv *env, jobject this) { return NUM_BUTTONS; } diff --git a/src/native/linux/org_lwjgl_opengl_Display.c b/src/native/linux/org_lwjgl_opengl_Display.c index 74b39f05..09b8410e 100644 --- a/src/native/linux/org_lwjgl_opengl_Display.c +++ b/src/native/linux/org_lwjgl_opengl_Display.c @@ -115,7 +115,7 @@ bool checkXError(JNIEnv *env) { if (env != NULL) throwException(env, error_message); else - printfDebugJava(env, error_message); + printfDebug(error_message); return false; } else return true; @@ -691,14 +691,6 @@ JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_init(JNIEnv *env, j return initDisplay(env, getCurrentScreen()); } -JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getAdapter(JNIEnv *env , jobject this) { - return NULL; -} - -JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getVersion(JNIEnv *env, jobject this) { - return NULL; -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_createContext(JNIEnv *env, jobject this, jobject pixel_format) { Display *disp = incDisplay(env); if (disp == NULL) {