- System.out.println(new VirtualUniverse());
-
- GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
- System.out.println("template="+template);
-
- //X11GraphicsDevice
- GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
- System.out.println("device="+device);
-
- sun.awt.X11GraphicsDevice x11device = (sun.awt.X11GraphicsDevice)device;
-
- GraphicsConfiguration[] configs = x11device.getConfigurations();
-
- config = template.getBestConfiguration(configs);
- System.out.println(config);
上述类,仅在getBestConfiguration()新建
doWork()调用。
JoglPipeline.getBestConfiguration(),大约8730处开始:
- Frame f = new Frame(device.getDefaultConfiguration());
- f.setUndecorated(true);
- f.setLayout(new BorderLayout());
- capturer = new CapabilitiesCapturer();
- try {
- awtConfig = createAwtGraphicsConfiguration(caps, capturer, screen);
- QueryCanvas canvas = new QueryCanvas(awtConfig, capturer);
- f.add(canvas, BorderLayout.CENTER);
- f.setSize(MIN_FRAME_SIZE, MIN_FRAME_SIZE);
- f.setVisible(true);
在setVisible()的时候,嗝屁了。
glDrawable.setRealized(true);
正确:jogamp.opengl.x11.glx.X11OnscreenGLXDrawable(两层继承:X11GLXDrawable, GLDrawableImpl) implements GLDrawable
错误:jogamp.opengl.egl.EGLDrawable(继承GLDrawableImpl)
到了这里,直接原因清楚了。之后就是研究,为什么glDrawable不同。