Package org.lwjgl
Class Sys
java.lang.Object
org.lwjgl.Sys
System class (named Sys so as not to conflict with java.lang.System)
- Version:
- $Revision$ $Id$
- Author:
- cix_foo invalid input: '<'cix_foo@users.sourceforge.net>
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Attempt to display a modal alert to the user.static String
Get the contents of the system clipboard.static long
getTime()
Gets the current value of the hires timer, in ticks.static long
Obtains the number of ticks that the hires timer does in a second.static String
Return the version of the core LWJGL libraries as a String.static void
Initialization.static boolean
is64Bit()
Returns true if a 64bit implementation was loaded.static boolean
Open the system web browser and point it at the specified URL.
-
Method Details
-
getVersion
Return the version of the core LWJGL libraries as a String. -
initialize
public static void initialize()Initialization. This is just a dummy method to trigger the static constructor. -
is64Bit
public static boolean is64Bit()Returns true if a 64bit implementation was loaded. -
getTimerResolution
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:
- timer resolution in ticks per second or 0 if no timer is present.
-
getTime
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:
- the current hires time, in ticks (always >= 0)
-
alert
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
- The title of the alert. We suggest using the title of your game.message
- The message text for the alert.
-
openURL
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
- The URL. Ensure that the URL is properly encoded.- Returns:
- false if we are CERTAIN the call has failed
-
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:
- a String, or null if there is no system clipboard.
-