summaryrefslogtreecommitdiffstats
path: root/src/demos/es1/RedSquare.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-06-01 10:43:49 +0000
committerSven Gothel <[email protected]>2008-06-01 10:43:49 +0000
commit04053312e8b8d27fb95aed807009a58489025923 (patch)
treeb71d195235e9e6dd6e2f94f6366f018fe8b1a955 /src/demos/es1/RedSquare.java
parent274786395d995674eb4b776451795e045ba714dc (diff)
wip
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@241 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/es1/RedSquare.java')
-rwxr-xr-xsrc/demos/es1/RedSquare.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java
index 913a099..fa6b435 100755
--- a/src/demos/es1/RedSquare.java
+++ b/src/demos/es1/RedSquare.java
@@ -10,10 +10,16 @@ import com.sun.javafx.newt.*;
public class RedSquare implements MouseListener {
public boolean quit = false;
+ public boolean toggleFS = false;
public void mouseClicked(MouseEvent e) {
- if(e.getClickCount()>1) {
- quit=true;
+ switch(e.getClickCount()) {
+ case 1:
+ toggleFS=true;
+ break;
+ default:
+ quit=true;
+ break;
}
}
public void mouseEntered(MouseEvent e) {
@@ -42,9 +48,8 @@ public class RedSquare implements MouseListener {
// Size OpenGL to Video Surface
int width = 800;
int height = 480;
- if (!window.setFullscreen(true)) {
- window.setSize(width, height);
- }
+ window.setSize(width, height);
+ window.setFullscreen(true);
// Hook this into EGL
GLDrawableFactory factory = GLDrawableFactory.getFactory(GLDrawableFactory.PROFILE_GLES1, window);
@@ -122,6 +127,11 @@ public class RedSquare implements MouseListener {
drawable.swapBuffers();
+ if(ml.toggleFS) {
+ window.setFullscreen(!window.isFullscreen());
+ ml.toggleFS=false;
+ }
+
window.pumpMessages();
try {