diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/demos/es1/RedSquare.java | 12 | ||||
-rwxr-xr-x | src/demos/es1/angeles/Main.java | 12 |
2 files changed, 12 insertions, 12 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(); diff --git a/src/demos/es1/angeles/Main.java b/src/demos/es1/angeles/Main.java index b0e264a..fc408cc 100755 --- a/src/demos/es1/angeles/Main.java +++ b/src/demos/es1/angeles/Main.java @@ -29,9 +29,9 @@ public class Main implements MouseListener { public static void main(String[] args) { System.out.println("Angeles 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 Main ml = new Main(); window.addMouseListener(ml); @@ -44,15 +44,14 @@ public class Main 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(); @@ -83,6 +82,7 @@ public class Main implements MouseListener { context.release(); context.destroy(); drawable.destroy(); + factory.shutdown(); System.out.println("Angeles shut down cleanly."); } catch (GLException e) { e.printStackTrace(); |