From 880653d31a8f1ff8384fdbc75b84934bceecfdb8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 18 Nov 2000 06:43:49 +0000 Subject: Initial revision --- demos/RonsDemos/nonAnimApplet.skel | 120 +++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 demos/RonsDemos/nonAnimApplet.skel (limited to 'demos/RonsDemos/nonAnimApplet.skel') diff --git a/demos/RonsDemos/nonAnimApplet.skel b/demos/RonsDemos/nonAnimApplet.skel new file mode 100644 index 0000000..a1697d2 --- /dev/null +++ b/demos/RonsDemos/nonAnimApplet.skel @@ -0,0 +1,120 @@ +/** + * Skeleton for non-animated applets (applets which redraw once each + * time the repaint() method is called, but do not continually animate + * automatically). + */ + +/** + * @(#) [place applet name here].java + * @(#) author: [place author here] (converted to Java by Ron Cemer) + */ + +import java.applet.*; +import java.awt.*; +import java.awt.event.*; +import java.lang.*; +import java.util.*; +import java.io.*; +import java.util.*; +import gl4java.GLContext; +import gl4java.awt.GLCanvas; + +public class myapplet extends Applet +{ + myappletCanvas canvas = null; + + + /* Initialize the applet */ + + + public void init() + { + Dimension d = getSize(); + setLayout(new BorderLayout()); + canvas = new myappletCanvas(d.width, d.height); + add("Center", canvas); + } + + + /* Start the applet */ + + + public void start() + { + } + + + /* Stop the applet */ + + + public void stop() + { + } + + + /* Destroy the applet */ + + + public void destroy() + { + canvas.destroy(); + } + + + /* Local GLCanvas extension class */ + + + private class myappletCanvas extends GLCanvas + { + public myappletCanvas(int w, int h) + { + super(w, h); + GLContext.gljNativeDebug = false; + GLContext.gljClassDebug = false; + } + + public void preInit() + { + doubleBuffer = true; + stereoView = false; + } + + public void init() + { + System.out.println("init(): " + this); + reshape(getSize().width, getSize().height); + +// Put OpenGL initialization code here. + + glj.gljCheckGL(); + } + + public void destroy() + { + System.out.println("destroy(): " + this); + +// Put any special takedown code here. + + cvsDispose(); + } + + public void reshape(int width, int height) + { + gl.glViewport(0,0,width,height); + +// Put any custom reshape code here. + + } + + public void display() + { + if (glj.gljMakeCurrent(true) == false) return; + +// Put drawing code here. + + glj.gljSwap(); + glj.gljCheckGL(); + glj.gljFree(); + } + } +} -- cgit v1.2.3