Added platform specific getJNIVersion implementations

This commit is contained in:
Elias Naur 2008-04-30 14:58:47 +00:00
parent 100dfa86a6
commit 8b0b1b8b63
9 changed files with 29 additions and 11 deletions

View file

@ -39,9 +39,6 @@ package org.lwjgl;
* $Id$
*/
abstract class DefaultSysImplementation implements SysImplementation {
/** Included to let native have easy access to Sys.JNI_VERSION */
private final static int JNI_VERSION = Sys.JNI_VERSION;
public native int getJNIVersion();
public native void setDebug(boolean debug);

View file

@ -39,12 +39,14 @@ package org.lwjgl;
* $Id$
*/
final class LinuxSysImplementation extends J2SESysImplementation {
private final static int JNI_VERSION = 16;
static {
java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded
}
public int getRequiredJNIVersion() {
return 16;
return JNI_VERSION;
}
public boolean openURL(final String url) {

View file

@ -45,13 +45,15 @@ import com.apple.eio.FileManager;
* $Id$
*/
final class MacOSXSysImplementation extends J2SESysImplementation {
private final static int JNI_VERSION = 16;
static {
// Make sure AWT is properly initialized. This avoids hangs on Mac OS X 10.3
Toolkit.getDefaultToolkit();
}
public int getRequiredJNIVersion() {
return 16;
return JNI_VERSION;
}
public boolean openURL(String url) {

View file

@ -39,12 +39,14 @@ package org.lwjgl;
* $Id$
*/
final class WindowsSysImplementation extends DefaultSysImplementation {
private final static int JNI_VERSION = 16;
static {
Sys.initialize();
}
public int getRequiredJNIVersion() {
return 16;
return JNI_VERSION;
}
public long getTimerResolution() {