diff options
author | Sven Gothel <[email protected]> | 2001-05-09 13:06:09 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2001-05-09 13:06:09 +0000 |
commit | 7473a5ed807ed01852df6aa1bdb0634bcabd219e (patch) | |
tree | fa2a0dc0cbff6edb09e18de84b8ed11a3ac49842 /demos/SwingDemos/CrossColorJPanel.java | |
parent | 99f156a9d9e86e6d835ad9791071b23335476330 (diff) |
2.7.2.0 swing and minor changes
Diffstat (limited to 'demos/SwingDemos/CrossColorJPanel.java')
-rw-r--r-- | demos/SwingDemos/CrossColorJPanel.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/demos/SwingDemos/CrossColorJPanel.java b/demos/SwingDemos/CrossColorJPanel.java index 97ed71f..2c4bdaa 100644 --- a/demos/SwingDemos/CrossColorJPanel.java +++ b/demos/SwingDemos/CrossColorJPanel.java @@ -7,12 +7,11 @@ public class CrossColorJPanel extends GLJPanel { public CrossColorJPanel( ) { - super(); + super(false); } public void init() { - reshape(getSize().width, getSize().height); } public void display() @@ -20,6 +19,7 @@ public class CrossColorJPanel extends GLJPanel int i; gl.glPushMatrix(); + gl.glClear(GL_COLOR_BUFFER_BIT); gl.glBegin(GLEnum.GL_LINES); @@ -43,8 +43,18 @@ public class CrossColorJPanel extends GLJPanel gl.glPopMatrix(); } + public void resize ( int x, int y, int width, int height ) + { + System.out.println("reshape: "+x+"/"+y+": "+width+"x"+height); + gl.glViewport(x, y, width, height); + gl.glMatrixMode(GL_PROJECTION); + gl.glLoadIdentity(); + gl.glOrtho(0, 10, 0, 10, -50.0,50.0); + gl.glMatrixMode(GL_MODELVIEW); + } public void reshape( int width, int height ) { + System.out.println("reshape: "+width+"x"+height); gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL_PROJECTION); gl.glLoadIdentity(); |