Revision: 2962
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=2962&view=rev
Author: elias_naur
Date: 2008-02-01 04:02:54 -0800 (Fri, 01 Feb 2008)
Log Message:
-----------
Added AWTInputAdapter.isCreated() requested by kevglass
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/AWTInputAdapter.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AWTInputAdapter.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTInputAdapter.java 2008-01-31 19:22:32 UTC (rev 2961)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/AWTInputAdapter.java 2008-02-01 12:02:54 UTC (rev 2962)
@@ -58,7 +58,7 @@
* @param canvas The canvas to receive input from.
*/
public static synchronized void create(AWTGLCanvas canvas) throws LWJGLException {
- if (awt_input != null)
+ if (isCreated())
throw new IllegalStateException("You need to destroy() the adapter.");
awt_input = AWTGLCanvas.getImplementation().createInput(canvas);
// Invoke Mouse.create(awt_input) and Keyboard.create(awt_input)
@@ -86,8 +86,12 @@
awt_input.init();
}
+ public static synchronized boolean isCreated() {
+ return awt_input != null;
+ }
+
public static synchronized void destroy() {
- if (awt_input != null) {
+ if (isCreated()) {
Mouse.destroy();
Keyboard.destroy();
awt_input.destroy();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|