diff options
author | Sven Gothel <[email protected]> | 2009-09-29 10:02:28 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-09-29 10:02:28 -0700 |
commit | 30c1fe267c0cf47a25db06ac93c6065881af2a20 (patch) | |
tree | 9219267ce49ace1ac5215ad23c0c9aa3e0f029a3 /src/demos/GLNewtRun.java | |
parent | c752f7117dc38eed1caa870d7c96a084cea04f88 (diff) |
GLNewtRun: Add parenting re-pos/re-size test; JOGLNewtAppletBase: Remove GLProfile, must be used in Capabilities/Window construction phase
Diffstat (limited to 'src/demos/GLNewtRun.java')
-rwxr-xr-x | src/demos/GLNewtRun.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/demos/GLNewtRun.java b/src/demos/GLNewtRun.java index 9e31d6b..dca68b4 100755 --- a/src/demos/GLNewtRun.java +++ b/src/demos/GLNewtRun.java @@ -26,12 +26,27 @@ public class GLNewtRun implements WindowListener, KeyListener, MouseListener { quit = true; } + static int dx=0; + static int dy=0; + static int dw=0; + static int dh=0; + public void keyPressed(KeyEvent e) { System.out.println(e); if(e.getKeyChar()=='f') { window.setFullscreen(!window.isFullscreen()); } else if(e.getKeyChar()=='q') { quit = true; + } else if(e.getKeyChar()=='p') { + int x = window.getX() + dx; + int y = window.getY() + dy; + System.out.println("Reset Pos "+x+"/"+y); + window.setPosition(x, y); + } else if(e.getKeyChar()=='s') { + int w = window.getWidth() + dw; + int h = window.getHeight() + dh; + System.out.println("Reset Size "+w+"x"+h); + window.setSize(w, h); } } public void keyReleased(KeyEvent e) { @@ -131,6 +146,18 @@ public class GLNewtRun implements WindowListener, KeyListener, MouseListener { height = str2int(args[i], height); } else if(args[i].startsWith("-GL")) { glProfileStr = args[i].substring(1); + } else if(args[i].equals("-dx")) { + i++; + dx = str2int(args[i], dx); + } else if(args[i].equals("-dy")) { + i++; + dy = str2int(args[i], dy); + } else if(args[i].equals("-dw")) { + i++; + dw = str2int(args[i], dw); + } else if(args[i].equals("-dh")) { + i++; + dh = str2int(args[i], dh); } i++; } @@ -172,7 +199,7 @@ public class GLNewtRun implements WindowListener, KeyListener, MouseListener { if(parented) { Window parent = NewtFactory.createWindow(nScreen, caps, undecorated); parent.setPosition(x_p, y_p); - parent.setSize(2*width, 2*height); + parent.setSize(width+width/10, height+height/10); parent.setVisible(true); nWindow = NewtFactory.createWindow(parent.getWindowHandle(), nScreen, caps, undecorated); } else { |