aboutsummaryrefslogtreecommitdiffstats
path: root/demos/HodglimsNeHe/Lesson8.java
diff options
context:
space:
mode:
Diffstat (limited to 'demos/HodglimsNeHe/Lesson8.java')
-rw-r--r--demos/HodglimsNeHe/Lesson8.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/demos/HodglimsNeHe/Lesson8.java b/demos/HodglimsNeHe/Lesson8.java
index f8735d5..f0dc1cc 100644
--- a/demos/HodglimsNeHe/Lesson8.java
+++ b/demos/HodglimsNeHe/Lesson8.java
@@ -360,6 +360,7 @@ public class Lesson8 extends Applet
//Swap buffers
glj.gljSwap();
+ glj.gljFree();
}
@@ -380,6 +381,10 @@ public class Lesson8 extends Applet
*/
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
@@ -481,6 +486,8 @@ public class Lesson8 extends Applet
break;
}
}
+ glj.gljFree();
+
}