OSDN Git Service

Add the ability to test whether the canvas context is current. This is mainly useful...
authorTalin <viridia@gmail.com>
Sat, 16 Feb 2013 08:17:10 +0000 (00:17 -0800)
committerTalin <viridia@gmail.com>
Sat, 16 Feb 2013 08:17:10 +0000 (00:17 -0800)
backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglAWTCanvas.java

index e3c6429..4dca75c 100644 (file)
@@ -393,6 +393,15 @@ public class LwjglAWTCanvas implements Application {
                }
        }
 
+       /** Test whether the canvas' context is current. */
+       public boolean isCurrent() {
+               try {
+                       return canvas.isCurrent();
+               } catch (LWJGLException ex) {
+                       throw new GdxRuntimeException(ex);
+               }
+       }
+
        /** @param cursor May be null. */
        public void setCursor (Cursor cursor) {
                this.cursor = cursor;