From 3e2b16a820bfe03f8f3837c3aaa615c8c4b7f18c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 13 Feb 2001 05:32:07 +0000 Subject: JAWT Support JDK >=1.3 --- demos/HodglimsNeHe/Lesson18.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'demos/HodglimsNeHe/Lesson18.java') diff --git a/demos/HodglimsNeHe/Lesson18.java b/demos/HodglimsNeHe/Lesson18.java index b63a627..98bc1cc 100644 --- a/demos/HodglimsNeHe/Lesson18.java +++ b/demos/HodglimsNeHe/Lesson18.java @@ -107,7 +107,7 @@ public class Lesson18 extends Applet int part2; // End Of Disc int p1=0; // Increase 1 int p2=1; // Increase 2 - int quadratic; // Storage For Our Quadratic Objects + long quadratic; // Storage For Our Quadratic Objects int object=0; // Which Object To Draw public renderCanvas(int w, int h) { @@ -278,7 +278,11 @@ public class Lesson18 extends Applet } public void display() { - //Clear The Screen And The Depth Buffer + //Ensure GL is initialised correctly + if (glj.gljMakeCurrent(true) == false) + return; + +//Clear The Screen And The Depth Buffer gl.glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); //Reset The View gl.glLoadIdentity(); @@ -332,12 +336,17 @@ public class Lesson18 extends Applet //Swap buffers glj.gljSwap(); + glj.gljFree(); } public void keyTyped(KeyEvent e) { //We are not handling any keyboard events yet } public void keyPressed(KeyEvent e) { + //Ensure GL is initialised correctly + if (glj.gljMakeCurrent(true) == false) + return; + switch(e.getKeyCode()) { //Switch ON/OFF light when L is pressed case KeyEvent.VK_L: @@ -398,6 +407,8 @@ public class Lesson18 extends Applet } break; } + glj.gljFree(); + } public void keyReleased(KeyEvent e) { switch(e.getKeyCode()) { -- cgit v1.2.3