Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make JOGL 2.0 work with SWT?
    text
    copied!<p>I'm trying to get SWT working with the newest JOGL (2.0).</p> <p>I tried <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet209.java?view=markup" rel="nofollow noreferrer">SWT snippet 209</a>, but it doesn't work. The problem is caused by the following line:</p> <pre><code>final GLContext context = GLDrawableFactory.getFactory().createExternalGLContext(); </code></pre> <p>...but when I change <code>getFactory()</code> to <code>getFactory(GLProfile.getDefault())</code> (to make it compatible with the new API), it crashes on <code>createExternalGLContext()</code> with <code>javax.media.opengl.GLException: Error: current context null</code>. I don't understand this message: I'm trying to create a new context, and it complains that the current is null. Why?</p> <p>Maybe there is some other way to create a <code>GLContext</code>?</p> <p>Or maybe it is possible to use <code>GLEventListener</code> with SWT <code>GLCanvas</code>?</p> <p>PS. I placed my modified version of the snippet <a href="http://m01.pastebin.com/1JW3CCxi" rel="nofollow noreferrer">here</a>.</p> <hr> <p>Edit: now I understand the error message. <a href="http://jogamp.org/deployment/jogl-next/javadoc_public/javax/media/opengl/GLDrawableFactory.html#createExternalGLContext%28%29" rel="nofollow noreferrer">Documentation</a> says:</p> <blockquote> <p>The underlying OpenGL context must be current on the current thread at the time this method is called.</p> </blockquote> <p>How to create the first <code>GLContext</code>?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload