private static void testContext(final AccelGraphicsConfig agc) { BufferedContext c = agc.getContext(); final AccelDeviceEventListener l = new AccelDeviceEventListener() { public void onDeviceDispose() { System.out.println("onDeviceDispose invoked"); agc.removeDeviceEventListener(this); } public void onDeviceReset() { System.out.println("onDeviceReset invoked"); } }; agc.addDeviceEventListener(l); RenderQueue rq = c.getRenderQueue(); rq.lock(); try { c.saveState(); rq.flushNow(); c.restoreState(); rq.flushNow(); System.out.println("Passed: Save/Restore"); } finally { rq.unlock(); } }
@Override public void addDeviceEventListener(AccelDeviceEventListener l) { int displayID = getDevice().getCGDisplayID(); AccelDeviceEventNotifier.addListener(l, displayID); }
@Override public void removeDeviceEventListener(AccelDeviceEventListener l) { AccelDeviceEventNotifier.removeListener(l); }
@Override public void addDeviceEventListener(AccelDeviceEventListener l) { AccelDeviceEventNotifier.addListener(l, device.getScreen()); }
@Override public void addDeviceEventListener(AccelDeviceEventListener l) { AccelDeviceEventNotifier.addListener(l, screen.getScreen()); }