diff options
author | Sven Gothel <[email protected]> | 2010-06-10 06:14:44 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-06-10 06:14:44 +0200 |
commit | 348c43a12199e71017767930b0b42d939db47312 (patch) | |
tree | 502a113716308414e1345413dd35072a4b66459f /src/demos | |
parent | 7bf502292901259eef302ef23b5c558b80f6b3f8 (diff) |
Adding GLProfile.initSingleton() call, ensuring [multithreading] intitialization can be done in time
Diffstat (limited to 'src/demos')
37 files changed, 143 insertions, 2 deletions
diff --git a/src/demos/applets/GearsApplet.java b/src/demos/applets/GearsApplet.java index fc3d0ec..dd5183b 100755 --- a/src/demos/applets/GearsApplet.java +++ b/src/demos/applets/GearsApplet.java @@ -3,6 +3,7 @@ package demos.applets; import java.applet.*; import java.awt.*; import demos.gears.Gears; +import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.util.FPSAnimator; @@ -11,6 +12,9 @@ import com.jogamp.opengl.util.FPSAnimator; referenced from a web page via an <applet> tag. */ public class GearsApplet extends Applet { + static { + GLProfile.initSingleton(); + } private Animator animator; public void init() { diff --git a/src/demos/applets/GearsJOALApplet.java b/src/demos/applets/GearsJOALApplet.java index 9cc8693..54ee99f 100755 --- a/src/demos/applets/GearsJOALApplet.java +++ b/src/demos/applets/GearsJOALApplet.java @@ -4,6 +4,7 @@ import demos.gears.Gears; import java.applet.Applet; import java.awt.EventQueue; import java.awt.GridLayout; +import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.util.FPSAnimator; @@ -15,6 +16,9 @@ import demos.devmaster.lesson1.SingleStaticSource; must be referenced from a web page via an <applet> tag. */ public class GearsJOALApplet extends Applet { + static { + GLProfile.initSingleton(); + } private Animator animator; public void init() { diff --git a/src/demos/cg/runtime_ogl/cgGL_vertex_example.java b/src/demos/cg/runtime_ogl/cgGL_vertex_example.java index 3579f27..db263af 100644 --- a/src/demos/cg/runtime_ogl/cgGL_vertex_example.java +++ b/src/demos/cg/runtime_ogl/cgGL_vertex_example.java @@ -49,6 +49,9 @@ import java.io.*; */ public class cgGL_vertex_example implements GLEventListener { + static { + GLProfile.initSingleton(); + } /******************************************************************************/ /*** Static Data ***/ @@ -271,8 +274,10 @@ public class cgGL_vertex_example implements GLEventListener public static void main(String[] argv) { - Frame frame = new Frame("NVidia Cg Toolkit \"cgGL_vertex_example\" demo"); + // GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); + // GLCanvas canvas = new GLCanvas(caps); GLCanvas canvas = new GLCanvas(); + Frame frame = new Frame("NVidia Cg Toolkit \"cgGL_vertex_example\" demo"); canvas.addGLEventListener(new cgGL_vertex_example()); frame.add(canvas); diff --git a/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java b/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java index b550324..6502720 100644 --- a/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java +++ b/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java @@ -53,6 +53,9 @@ import java.util.*; */ public class runtime_ogl_vertex_fragment implements GLEventListener { + static { + GLProfile.initSingleton(); + } // Global variables: hold the Cg context that we're storing our programs // in as well as handles to the vertex and fragment program used in this diff --git a/src/demos/cubefbo/FBCubes.java b/src/demos/cubefbo/FBCubes.java index 39494a0..99ed710 100755 --- a/src/demos/cubefbo/FBCubes.java +++ b/src/demos/cubefbo/FBCubes.java @@ -36,6 +36,7 @@ package demos.cubefbo; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; +import javax.media.opengl.GLProfile; import javax.media.opengl.DebugGL2; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; @@ -48,6 +49,9 @@ import com.jogamp.opengl.util.FBObject; class FBCubes implements GLEventListener, MouseListener, MouseMotionListener { + static { + GLProfile.initSingleton(); + } private static final int FBO_SIZE = 128; diff --git a/src/demos/cubefbo/Main.java b/src/demos/cubefbo/Main.java index 2d8a36b..054aea4 100755 --- a/src/demos/cubefbo/Main.java +++ b/src/demos/cubefbo/Main.java @@ -36,6 +36,7 @@ package demos.cubefbo; import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import javax.media.opengl.GLProfile; import javax.media.opengl.GLCapabilities; import javax.media.opengl.awt.GLCanvas; import com.jogamp.opengl.util.Animator; @@ -44,6 +45,10 @@ import com.jogamp.opengl.util.FPSAnimator; public class Main { + static { + GLProfile.initSingleton(); + } + public static void main(String[] args) { GLCapabilities caps = new GLCapabilities(null); diff --git a/src/demos/fullscreen/GearsFullscreen.java b/src/demos/fullscreen/GearsFullscreen.java index 0dac67f..2fa9937 100755 --- a/src/demos/fullscreen/GearsFullscreen.java +++ b/src/demos/fullscreen/GearsFullscreen.java @@ -5,6 +5,7 @@ import java.awt.event.*; import demos.gears.Gears; import demos.util.*; +import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import com.jogamp.opengl.util.Animator; @@ -21,6 +22,10 @@ import com.jogamp.opengl.util.Animator; */ public class GearsFullscreen { + static { + GLProfile.initSingleton(); + } + private GraphicsDevice dev; private DisplayMode origMode; private boolean fullScreen; diff --git a/src/demos/fullscreen/GearsFullscreen2.java b/src/demos/fullscreen/GearsFullscreen2.java index 38911a4..1984acc 100755 --- a/src/demos/fullscreen/GearsFullscreen2.java +++ b/src/demos/fullscreen/GearsFullscreen2.java @@ -10,6 +10,7 @@ import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import com.jogamp.opengl.util.Animator; import javax.swing.JButton; @@ -30,6 +31,10 @@ import javax.swing.ToolTipManager; */ public class GearsFullscreen2 { + static { + GLProfile.initSingleton(); + } + private GraphicsDevice dev; private DisplayMode origMode; private boolean fullScreen; diff --git a/src/demos/gamma/TestGamma.java b/src/demos/gamma/TestGamma.java index 4dff454..fc6a34f 100755 --- a/src/demos/gamma/TestGamma.java +++ b/src/demos/gamma/TestGamma.java @@ -51,6 +51,10 @@ import com.jogamp.opengl.util.Gamma; public class TestGamma implements GLEventListener { + static { + GLProfile.initSingleton(); + } + private static void usage() { System.out.println("Usage: java TestGamma [gamma value] [brightness value] [contrast value]"); System.exit(1); diff --git a/src/demos/gears/Gears.java b/src/demos/gears/Gears.java index 853444d..33446c7 100644 --- a/src/demos/gears/Gears.java +++ b/src/demos/gears/Gears.java @@ -28,6 +28,9 @@ import com.jogamp.opengl.util.Animator; public class Gears implements GLEventListener, MouseListener, MouseMotionListener { public static void main(String[] args) { + // RTFM .. essential for multithreading. + GLProfile.initSingleton(); + Frame frame = new Frame("Gear Demo"); GLCanvas canvas = new GLCanvas(); // GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java index 900d7f3..d4748b4 100755 --- a/src/demos/hdr/HDR.java +++ b/src/demos/hdr/HDR.java @@ -49,6 +49,9 @@ import javax.swing.JOptionPane; */ public class HDR extends Demo { + static { + GLProfile.initSingleton(); + } private static String[] defaultArgs = { "demos/data/images/stpeters_cross.hdr", "512", diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java index 0873d63..b22073a 100644 --- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java +++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java @@ -55,6 +55,7 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.IOException; import java.util.ArrayList; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -80,6 +81,9 @@ import javax.swing.JOptionPane; */ public class HWShadowmapsSimple extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { final GLCanvas canvas = new GLCanvas(); final HWShadowmapsSimple demo = new HWShadowmapsSimple(); diff --git a/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java b/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java index e445b39..49404b3 100644 --- a/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java +++ b/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java @@ -55,6 +55,7 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.IOException; import java.nio.FloatBuffer; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -84,6 +85,9 @@ import javax.media.opengl.glu.GLU; */ public class InfiniteShadowVolumes extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { GLCapabilities caps = new GLCapabilities(null); caps.setStencilBits(16); diff --git a/src/demos/j2d/CustomText.java b/src/demos/j2d/CustomText.java index b5a4f57..86a423f 100755 --- a/src/demos/j2d/CustomText.java +++ b/src/demos/j2d/CustomText.java @@ -69,6 +69,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -85,6 +86,9 @@ import javax.swing.JPanel; to do text filled with a linear Java 2D gradient. */ public class CustomText extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { JFrame frame = new JFrame("Custom Text"); frame.getContentPane().setLayout(new BorderLayout()); diff --git a/src/demos/j2d/FlyingText.java b/src/demos/j2d/FlyingText.java index 9648d4f..d5a83a6 100755 --- a/src/demos/j2d/FlyingText.java +++ b/src/demos/j2d/FlyingText.java @@ -65,6 +65,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -86,6 +87,9 @@ import javax.swing.event.ChangeListener; shadow effect. */ public class FlyingText extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { JFrame frame = new JFrame("Flying Text"); diff --git a/src/demos/j2d/TestOverlay.java b/src/demos/j2d/TestOverlay.java index 13cb39e..28c30fa 100755 --- a/src/demos/j2d/TestOverlay.java +++ b/src/demos/j2d/TestOverlay.java @@ -54,6 +54,7 @@ import java.awt.event.WindowEvent; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.text.DecimalFormat; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; @@ -65,6 +66,9 @@ import com.jogamp.opengl.util.Animator; with moving Java 2D-rendered text on top. */ public class TestOverlay implements GLEventListener { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { Frame frame = new Frame("Java 2D Overlay Test"); GLCapabilities caps = new GLCapabilities(null); diff --git a/src/demos/j2d/TestTextRenderer.java b/src/demos/j2d/TestTextRenderer.java index 5d93558..d5ec735 100755 --- a/src/demos/j2d/TestTextRenderer.java +++ b/src/demos/j2d/TestTextRenderer.java @@ -50,6 +50,7 @@ import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.geom.Rectangle2D; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; @@ -63,6 +64,9 @@ import com.jogamp.opengl.util.Animator; with moving Java 2D-rendered text on top. */ public class TestTextRenderer implements GLEventListener { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { Frame frame = new Frame("Text Renderer Test"); diff --git a/src/demos/j2d/TestTextureRenderer.java b/src/demos/j2d/TestTextureRenderer.java index 60bb3a4..87baa1d 100755 --- a/src/demos/j2d/TestTextureRenderer.java +++ b/src/demos/j2d/TestTextureRenderer.java @@ -70,6 +70,9 @@ import com.jogamp.opengl.util.Animator; underneath with moving Java 2D-rendered text on top. */ public class TestTextureRenderer implements GLEventListener { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { diff --git a/src/demos/j2d/TextCube.java b/src/demos/j2d/TextCube.java index 63ad427..3433463 100755 --- a/src/demos/j2d/TextCube.java +++ b/src/demos/j2d/TextCube.java @@ -52,7 +52,6 @@ import java.awt.event.WindowEvent; import java.awt.geom.Rectangle2D; import javax.media.opengl.GL; import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLProfile; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; import javax.media.opengl.GLAutoDrawable; @@ -66,6 +65,9 @@ import com.jogamp.opengl.util.Animator; /** Shows how to place 2D text in 3D using the TextRenderer. */ public class TextCube extends Demo { + static { + GLProfile.initSingleton(); + } private float xAng; private float yAng; private GLU glu = new GLU(); diff --git a/src/demos/j2d/TextFlow.java b/src/demos/j2d/TextFlow.java index 972618a..32c7600 100755 --- a/src/demos/j2d/TextFlow.java +++ b/src/demos/j2d/TextFlow.java @@ -74,6 +74,9 @@ import com.jogamp.opengl.util.Animator; screen. */ public class TextFlow extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { diff --git a/src/demos/misc/GLCapsTableDemo.java b/src/demos/misc/GLCapsTableDemo.java index d4c652a..daa6b45 100755 --- a/src/demos/misc/GLCapsTableDemo.java +++ b/src/demos/misc/GLCapsTableDemo.java @@ -15,6 +15,7 @@ import java.awt.event.ActionListener; import java.util.ArrayList; import javax.media.nativewindow.Capabilities; import javax.media.opengl.DefaultGLCapabilitiesChooser; +import javax.media.opengl.GLProfile; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLCapabilitiesChooser; import javax.media.opengl.awt.GLCanvas; @@ -50,6 +51,9 @@ public class GLCapsTableDemo implements GLCapabilitiesChooser { + static { + GLProfile.initSingleton(); + } private String[] colNames = {"Pfd", "H/W", "DblBfr", "Stereo", // index, hwaccel, double, stereo "CBits", "cR", "cG", "cB", "cA", // color bits diff --git a/src/demos/misc/Picking.java b/src/demos/misc/Picking.java index 1ba5f3e..472ed95 100755 --- a/src/demos/misc/Picking.java +++ b/src/demos/misc/Picking.java @@ -22,6 +22,9 @@ import com.jogamp.opengl.util.Animator; public class Picking { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { new Picking(); diff --git a/src/demos/multisample/Multisample.java b/src/demos/multisample/Multisample.java index 1c3c9ab..8e7facf 100755 --- a/src/demos/multisample/Multisample.java +++ b/src/demos/multisample/Multisample.java @@ -45,6 +45,9 @@ import javax.media.opengl.*; import javax.media.opengl.awt.GLCanvas; public class Multisample { + static { + GLProfile.initSingleton(); + } private GLCanvas canvas; // Simple class to warn if results are not going to be as expected diff --git a/src/demos/nurbs/curveapp/CurveApp.java b/src/demos/nurbs/curveapp/CurveApp.java index ff70f68..e125f62 100755 --- a/src/demos/nurbs/curveapp/CurveApp.java +++ b/src/demos/nurbs/curveapp/CurveApp.java @@ -9,6 +9,7 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import javax.media.opengl.GLProfile; import javax.media.opengl.GLCanvas; import javax.swing.ButtonGroup; import javax.swing.ImageIcon; @@ -40,6 +41,9 @@ import demos.nurbs.knotslidercomponent.JKnotSlider; @SuppressWarnings("serial") public class CurveApp extends JFrame implements ActionListener { + static { + GLProfile.initSingleton(); + } /** * Name of X-coord editing component of actually selected control point diff --git a/src/demos/nurbs/surfaceapp/SurfaceApp.java b/src/demos/nurbs/surfaceapp/SurfaceApp.java index 4018967..c19e8c6 100755 --- a/src/demos/nurbs/surfaceapp/SurfaceApp.java +++ b/src/demos/nurbs/surfaceapp/SurfaceApp.java @@ -31,6 +31,7 @@ import javax.swing.ToolTipManager; import demos.nurbs.icons.*; import demos.nurbs.knotslidercomponent.JKnotSlider; +import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; /** @@ -44,6 +45,9 @@ import javax.media.opengl.awt.GLCanvas; @SuppressWarnings("serial") public class SurfaceApp extends JFrame implements ActionListener { + static { + GLProfile.initSingleton(); + } /** * X-coord editing component name diff --git a/src/demos/printext/PrintExt.java b/src/demos/printext/PrintExt.java index d2abe17..5ab5b42 100755 --- a/src/demos/printext/PrintExt.java +++ b/src/demos/printext/PrintExt.java @@ -6,6 +6,7 @@ package demos.printext; import java.awt.Frame; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLEventListener; @@ -14,6 +15,9 @@ import javax.media.opengl.awt.GLCanvas; public class PrintExt { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { Frame frame = new Frame(); GLCanvas canvas = new GLCanvas(); diff --git a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java index d0e73ae..e939718 100644 --- a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java +++ b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java @@ -50,6 +50,7 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -74,6 +75,9 @@ import javax.swing.JOptionPane; * */ public class ProceduralTexturePhysics extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { GLCanvas canvas = new GLCanvas(); diff --git a/src/demos/swt/Snippet209.java b/src/demos/swt/Snippet209.java index f75d59d..1deb1c4 100644 --- a/src/demos/swt/Snippet209.java +++ b/src/demos/swt/Snippet209.java @@ -34,6 +34,9 @@ import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.glu.GLU; public class Snippet209 { + static { + GLProfile.initSingleton(); + } static void drawTorus(GL2 gl, float r, float R, int nsides, int rings) { float ringDelta = 2.0f * (float) Math.PI / rings; float sideDelta = 2.0f * (float) Math.PI / nsides; diff --git a/src/demos/tess/Tess.java b/src/demos/tess/Tess.java index 1137c15..8688570 100644 --- a/src/demos/tess/Tess.java +++ b/src/demos/tess/Tess.java @@ -45,6 +45,7 @@ package demos.tess; import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import javax.media.opengl.GLProfile; import javax.media.opengl.DebugGL2; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -73,6 +74,9 @@ import javax.media.opengl.glu.GLUtessellator; public class Tess { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { try { Frame frame = new Frame("Tess Demo"); diff --git a/src/demos/testContextDestruction/TestContextDestruction.java b/src/demos/testContextDestruction/TestContextDestruction.java index f1e8649..b2f2571 100755 --- a/src/demos/testContextDestruction/TestContextDestruction.java +++ b/src/demos/testContextDestruction/TestContextDestruction.java @@ -50,6 +50,7 @@ import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; +import javax.media.opengl.GLProfile; import javax.media.opengl.DebugGL2; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; @@ -67,6 +68,9 @@ import javax.swing.JFrame; as a GLCanvas is added to and removed from its parent container. */ public class TestContextDestruction { + static { + GLProfile.initSingleton(); + } private int gearDisplayList; private Frame frame1, frame2; private Component frame1ContainedComponent; diff --git a/src/demos/testContextSharing/TestContextSharing.java b/src/demos/testContextSharing/TestContextSharing.java index 84faf6f..9e6dcce 100644 --- a/src/demos/testContextSharing/TestContextSharing.java +++ b/src/demos/testContextSharing/TestContextSharing.java @@ -42,6 +42,7 @@ package demos.testContextSharing; import java.awt.BorderLayout; import java.awt.Frame; import java.util.Random; +import javax.media.opengl.GLProfile; import javax.media.opengl.DebugGL2; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -54,6 +55,9 @@ import javax.media.opengl.awt.GLCanvas; /** A simple demonstration of sharing of display lists between drawables. */ public class TestContextSharing { + static { + GLProfile.initSingleton(); + } private int gearDisplayList; private Frame delayedFrame; diff --git a/src/demos/texture/TestSubImage.java b/src/demos/texture/TestSubImage.java index 498428c..8f04e4a 100755 --- a/src/demos/texture/TestSubImage.java +++ b/src/demos/texture/TestSubImage.java @@ -60,6 +60,7 @@ import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -84,6 +85,9 @@ import javax.swing.KeyStroke; Texture.updateSubImage(). */ public class TestSubImage { + static { + GLProfile.initSingleton(); + } private boolean haveForcedImageType; private int forcedImageType; private List imageTypeMenuItems = new ArrayList(); diff --git a/src/demos/texture/TestTexture.java b/src/demos/texture/TestTexture.java index 6d39bbc..7524cd6 100755 --- a/src/demos/texture/TestTexture.java +++ b/src/demos/texture/TestTexture.java @@ -50,6 +50,7 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.PrintStream; +import javax.media.opengl.GLProfile; import javax.media.opengl.DebugGL2; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; @@ -72,6 +73,9 @@ import javax.swing.KeyStroke; /** Demonstrates simple use of the TextureIO texture loader. */ public class TestTexture implements GLEventListener { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { new TestTexture().run(args); } diff --git a/src/demos/vertexArrayRange/VertexArrayRange.java b/src/demos/vertexArrayRange/VertexArrayRange.java index c97428b..b41de6e 100644 --- a/src/demos/vertexArrayRange/VertexArrayRange.java +++ b/src/demos/vertexArrayRange/VertexArrayRange.java @@ -45,6 +45,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -88,6 +89,9 @@ import javax.swing.JOptionPane; respectively. </P> */ public class VertexArrayRange extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { boolean startSlow = false; diff --git a/src/demos/vertexBufferObject/VertexBufferObject.java b/src/demos/vertexBufferObject/VertexBufferObject.java index f06f266..28c9e0e 100644 --- a/src/demos/vertexBufferObject/VertexBufferObject.java +++ b/src/demos/vertexBufferObject/VertexBufferObject.java @@ -47,6 +47,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GL2ES1; @@ -85,6 +86,9 @@ import javax.swing.JOptionPane; */ public class VertexBufferObject extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { diff --git a/src/demos/vertexProgRefract/VertexProgRefract.java b/src/demos/vertexProgRefract/VertexProgRefract.java index 65b914c..99cf05e 100644 --- a/src/demos/vertexProgRefract/VertexProgRefract.java +++ b/src/demos/vertexProgRefract/VertexProgRefract.java @@ -75,6 +75,9 @@ import javax.swing.JOptionPane; */ public class VertexProgRefract extends Demo { + static { + GLProfile.initSingleton(); + } public static void main(String[] args) { GLCanvas canvas = new GLCanvas(); diff --git a/src/demos/vertexProgWarp/VertexProgWarp.java b/src/demos/vertexProgWarp/VertexProgWarp.java index e13656f..181d9ff 100644 --- a/src/demos/vertexProgWarp/VertexProgWarp.java +++ b/src/demos/vertexProgWarp/VertexProgWarp.java @@ -51,6 +51,7 @@ import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.IOException; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -75,6 +76,9 @@ import javax.swing.JOptionPane; */ public class VertexProgWarp extends Demo { + static { + GLProfile.initSingleton(); + } private Frame frame; private Animator animator; private volatile boolean quit; |