summaryrefslogtreecommitdiffstats
path: root/src/demos/es1/RedSquare.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-06-01 08:51:51 +0000
committerSven Gothel <[email protected]>2008-06-01 08:51:51 +0000
commit6c1d038a17057507a027abd47a869552d1c0b156 (patch)
tree5a05df2f945cd614d71b6857434a261178d2ba45 /src/demos/es1/RedSquare.java
parentfda78c151ffb6eee24ddc03a7a604e2598824502 (diff)
Adapted to latest JOGL refactoring ..
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@239 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/es1/RedSquare.java')
-rwxr-xr-xsrc/demos/es1/RedSquare.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java
index 433c926..aa97edf 100755
--- a/src/demos/es1/RedSquare.java
+++ b/src/demos/es1/RedSquare.java
@@ -32,9 +32,9 @@ public class RedSquare implements MouseListener {
public static void main(String[] args) {
System.out.println("RedSquare.main()");
try {
- Display display = new Display();
- Screen screen = new Screen(display);
- Window window = Window.create(screen, 0); // dummy VisualID
+ Display display = NewtFactory.createDisplay(null); // local display
+ Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ Window window = NewtFactory.createWindow(screen, 0); // dummy VisualID
RedSquare ml = new RedSquare();
window.addMouseListener(ml);
@@ -47,15 +47,14 @@ public class RedSquare implements MouseListener {
}
// Hook this into EGL
- GLDrawableFactory.initialize(GLDrawableFactory.PROFILE_GLES1);
- GLDrawableFactory factory = GLDrawableFactory.getFactory();
+ GLDrawableFactory factory = GLDrawableFactory.getFactory(GLDrawableFactory.PROFILE_GLES1, window);
GLCapabilities caps = new GLCapabilities();
// For emulation library, use 16 bpp
caps.setRedBits(5);
caps.setGreenBits(6);
caps.setBlueBits(5);
caps.setDepthBits(16);
- GLDrawable drawable = factory.getGLDrawable(window.getHandles(), caps, null);
+ GLDrawable drawable = factory.createGLDrawable(window, caps, null);
drawable.setRealized(true);
GLContext context = drawable.createContext(null);
context.makeCurrent();
@@ -134,6 +133,7 @@ public class RedSquare implements MouseListener {
context.release();
context.destroy();
drawable.destroy();
+ factory.shutdown();
System.out.println("RedSquare shut down cleanly.");
} catch (Throwable t) {
t.printStackTrace();