Top Description Fields Constructors Methods
org.lwjgl

public final Class Sys

extends Object
Class Inheritance
Imports
java.io.File, java.lang.reflect.Method, java.net.MalformedURLException, .URL, java.security.AccessController, .PrivilegedAction, .PrivilegedExceptionAction, org.lwjgl.input.Mouse

System class (named Sys so as not to conflict with java.lang.System)

Author
cix_foo
Version
$Revision$ $Id$

Field Summary

Modifier and TypeField and Description
private static final SysImplementation
implementation

The implementation instance to delegate platform specific behavior to

private static final boolean
private static final String
JNI_LIBRARY_NAME

The native library name

private static final String
private static final String
VERSION

Current version of library

Constructor Summary

AccessConstructor and Description
private
Sys()

No constructor for Sys.

Method Summary

Modifier and TypeMethod and Description
public static void
alert(String
The title of the alert. We suggest using the title of your game.
title
,
String
The message text for the alert.
message
)

Attempt to display a modal alert to the user.

private static SysImplementation
private static void
doLoadLibrary(final String lib_name)

public static String

Returns:

a String, or null if there is no system clipboard.
getClipboard
()

Get the contents of the system clipboard.

public static long

Returns:

the current hires time, in ticks (always >= 0)
getTime
()

Gets the current value of the hires timer, in ticks.

public static long

Returns:

timer resolution in ticks per second or 0 if no timer is present.
getTimerResolution
()

Obtains the number of ticks that the hires timer does in a second.

public static String
getVersion()

Return the version of the core LWJGL libraries as a String.

public static void
initialize()

Initialization.

public static boolean
is64Bit()

Returns true if a 64bit implementation was loaded.

private static void
loadLibrary(final String lib_name)

public static boolean

Returns:

false if we are CERTAIN the call has failed
openURL
(String
The URL. Ensure that the URL is properly encoded.
url
)

Open the system web browser and point it at the specified URL.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

implementationback to summary
private static final SysImplementation implementation

The implementation instance to delegate platform specific behavior to

is64Bitback to summary
private static final boolean is64Bit
JNI_LIBRARY_NAMEback to summary
private static final String JNI_LIBRARY_NAME

The native library name

POSTFIX64BITback to summary
private static final String POSTFIX64BIT
VERSIONback to summary
private static final String VERSION

Current version of library

Constructor Detail

Sysback to summary
private Sys()

No constructor for Sys.

Method Detail

alertback to summary
public static void alert(String title, String message)

Attempt to display a modal alert to the user. This method should be used when a game fails to initialize properly or crashes out losing its display in the process. It is provided because AWT may not be available on the target platform, although on Mac and Linux and other platforms supporting AWT we delegate the task to AWT instead of doing it ourselves.

The alert should display the title and the message and then the current thread should block until the user dismisses the alert - typically with an OK button click.

It may be that the user's system has no windowing system installed for some reason, in which case this method may do nothing at all, or attempt to provide some console output.

Parameters
title:String

The title of the alert. We suggest using the title of your game.

message:String

The message text for the alert.

createImplementationback to summary
private static SysImplementation createImplementation()
doLoadLibraryback to summary
private static void doLoadLibrary(final String lib_name)
getClipboardback to summary
public static String getClipboard()

Get the contents of the system clipboard. The system might not have a clipboard (particularly if it doesn't even have a keyboard) in which case we return null. Otherwise we return a String, which may be the empty string "".

Returns:String

a String, or null if there is no system clipboard.

getTimeback to summary
public static long getTime()

Gets the current value of the hires timer, in ticks. When the Sys class is first loaded the hires timer is reset to 0. If no hires timer is present then this method will always return 0.

NOTEZ BIEN that the hires timer WILL wrap around.

Returns:long

the current hires time, in ticks (always >= 0)

getTimerResolutionback to summary
public static long getTimerResolution()

Obtains the number of ticks that the hires timer does in a second. This method is fast; it should be called as frequently as possible, as it recalibrates the timer.

Returns:long

timer resolution in ticks per second or 0 if no timer is present.

getVersionback to summary
public static String getVersion()

Return the version of the core LWJGL libraries as a String.

initializeback to summary
public static void initialize()

Initialization. This is just a dummy method to trigger the static constructor.

is64Bitback to summary
public static boolean is64Bit()

Returns true if a 64bit implementation was loaded.

loadLibraryback to summary
private static void loadLibrary(final String lib_name)
openURLback to summary
public static boolean openURL(String url)

Open the system web browser and point it at the specified URL. It is recommended that this not be called whilst your game is running, but on application exit in a shutdown hook, as the screen resolution will not be reset when the browser is brought into view.

There is no guarantee that this will work, nor that we can detect if it has failed - hence we don't return success code or throw an Exception. This is just a best attempt at opening the URL given - don't rely on it to work!

Parameters
url:String

The URL. Ensure that the URL is properly encoded.

Returns:boolean

false if we are CERTAIN the call has failed