示例#1
0
 @BeforeClass
 public static void initClass() {
   glp = GLProfile.getGL2ES2();
   Assert.assertNotNull(glp);
   width = 640;
   height = 480;
 }
示例#2
0
  private void run(int type, PerfModule pm) {
    int width = 800;
    int height = 480;
    pmod = pm;
    System.err.println("Perftst.run()");
    try {
      GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
      // For emulation library, use 16 bpp
      caps.setRedBits(5);
      caps.setGreenBits(6);
      caps.setBlueBits(5);
      caps.setDepthBits(16);

      Window nWindow = null;
      if (0 != (type & USE_AWT)) {
        Display nDisplay =
            NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null); // local display
        Screen nScreen =
            NewtFactory.createScreen(NativeWindowFactory.TYPE_AWT, nDisplay, 0); // screen 0
        nWindow = NewtFactory.createWindow(NativeWindowFactory.TYPE_AWT, nScreen, caps);
        window = GLWindow.create(nWindow);
      } else {
        window = GLWindow.create(caps);
      }

      window.addMouseListener(this);
      window.addGLEventListener(this);
      // window.setEventHandlerMode(GLWindow.EVENT_HANDLER_GL_CURRENT); // default
      // window.setEventHandlerMode(GLWindow.EVENT_HANDLER_GL_NONE); // no current ..

      // Size OpenGL to Video Surface
      window.setSize(width, height);
      window.setFullscreen(true);
      window.setVisible(true);

      window.display();

      // Shut things down cooperatively
      window.destroy();
      window.getFactory().shutdown();
      System.out.println("Perftst shut down cleanly.");
    } catch (Throwable t) {
      t.printStackTrace();
    }
  }
示例#3
0
 static {
   GLProfile.initSingleton();
 }