aboutsummaryrefslogtreecommitdiffstats
path: root/demos/HodglimsNeHe/Lesson7.java
diff options
context:
space:
mode:
Diffstat (limited to 'demos/HodglimsNeHe/Lesson7.java')
-rw-r--r--demos/HodglimsNeHe/Lesson7.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/demos/HodglimsNeHe/Lesson7.java b/demos/HodglimsNeHe/Lesson7.java
index d6f65f4..a19a016 100644
--- a/demos/HodglimsNeHe/Lesson7.java
+++ b/demos/HodglimsNeHe/Lesson7.java
@@ -351,6 +351,7 @@ public class Lesson7 extends Applet
//Swap buffers
glj.gljSwap();
+ glj.gljFree();
}
// Methods required for the implementation of MouseListener
@@ -396,6 +397,10 @@ public class Lesson7 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
@@ -473,6 +478,8 @@ public class Lesson7 extends Applet
break;
}
}
+ glj.gljFree();
+
}