Login  Register

GLException with JOGL 1.1.1a, Win64 & remote desktop

Posted by OwenD on Nov 07, 2010; 1:12am
URL: https://forum.jogamp.org/GLException-with-JOGL-1-1-1a-Win64-remote-desktop-tp1855762.html

We are seeing the following GLException, which can be reproduced with a simple JOGL 1.1.1a application which uses JFrame and GLJPanel. The problem only occurs when running with a 64-bit JRE (windows-amd64) on the Windows host machine & starting the application over remote desktop. The application works correctly when: a. running locally (no remote desktop), b. using a 32-bit JRE (windows-i586), or c. starting the application locally then connecting via remote desktop. We have tried multiple host machines (XP x64, Win7 x64) with the same result. Adding the -Dsun.java2d.nodraw=true makes no difference. We are running Java version 1.6.0_22 JRE.

Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Error creating offscreen bitmap of width 592, height 573
        at com.sun.opengl.impl.windows.WindowsOffscreenGLDrawable.create(WindowsOffscreenGLDrawable.java:108)
        at com.sun.opengl.impl.windows.WindowsOffscreenGLDrawable.setSize(WindowsOffscreenGLDrawable.java:67)
        at javax.media.opengl.GLJPanel.initialize(GLJPanel.java:929)
        at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:488)
        at javax.swing.JComponent.paint(JComponent.java:1029)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
        at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:278)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
        at javax.swing.JComponent._paintImmediately(JComponent.java:5072)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

import javax.swing.*;
import java.awt.*;
import javax.media.opengl.*;

public class JOGLHelloWorld extends JFrame implements GLEventListener {

    public JOGLHelloWorld() {
        super("JOGL Hello World");

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setLayout(new BorderLayout());

        setSize(600, 600);
        setLocation(40, 40);
        setVisible(true);

        GLCapabilities caps = new GLCapabilities();
        caps.setDoubleBuffered(true);
        caps.setHardwareAccelerated(true);

        GLJPanel panel = new GLJPanel(caps);
        panel.addGLEventListener(this);

        add(panel, BorderLayout.CENTER);
    }

    public static void main(String[] args) {
        JOGLHelloWorld demo = new JOGLHelloWorld();
        demo.setVisible(true);
    }

    public void display(GLAutoDrawable drawable) {
        GL gl = drawable.getGL();

        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
        gl.glBegin(GL.GL_TRIANGLES);

        gl.glColor3f(1, 0, 0);
        gl.glVertex3f(0.25f, 0.25f, 0);

        gl.glColor3f(0, 1, 0);
        gl.glVertex3f(0.5f, 0.25f, 0);

        gl.glColor3f(0, 0, 1);
        gl.glVertex3f(0.25f, 0.5f, 0);

        gl.glEnd();
        gl.glFlush();
    }

    public void init(GLAutoDrawable drawable) {
        GL gl = drawable.getGL();

        gl.glClearColor(0, 0, 0, 0);
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        gl.glOrtho(0, 1, 0, 1, -1, 1);
    }

    public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {
    }

    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
    }
}

I realize that JOGL 1 is no longer being actively developed, so if anyone has any suggestions or workarounds that would be great.

Thanks.