diff options
Diffstat (limited to 'src/demos/es1/angeles/Main.java')
-rwxr-xr-x | src/demos/es1/angeles/Main.java | 12 |
1 files changed, 6 insertions, 6 deletions
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(); |