/** Setup the avaiatrix pipeline here */ private void setupAviatrix() { // Assemble a simple single-threaded pipeline. GLCapabilities caps = new GLCapabilities(); caps.setDoubleBuffered(true); caps.setHardwareAccelerated(true); GraphicsCullStage culler = new NullCullStage(); culler.setOffscreenCheckEnabled(false); GraphicsSortStage sorter = new SimpleTransparencySortStage(); surface = new DebugAWTSurface(caps); DefaultGraphicsPipeline pipeline = new DefaultGraphicsPipeline(); pipeline.setCuller(culler); pipeline.setSorter(sorter); pipeline.setGraphicsOutputDevice(surface); displayManager = new SingleDisplayCollection(); displayManager.addPipeline(pipeline); // Render manager sceneManager = new SingleThreadRenderManager(); sceneManager.addDisplay(displayManager); sceneManager.setMinimumFrameInterval(100); // Before putting the pipeline into run mode, put the canvas on // screen first. Component comp = (Component) surface.getSurfaceObject(); add(comp, BorderLayout.CENTER); }
/** When the window is opened, start everything up. */ public void windowOpened(WindowEvent evt) { sceneManager.setEnabled(true); }
/** * Exit the application * * @param evt The event that caused this method to be called. */ public void windowClosing(WindowEvent evt) { sceneManager.shutdown(); System.exit(0); }