GLException with SWT Demo

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

GLException with SWT Demo

Martin
Hi!
When trying to run the SWT Demo (snippet209), I got:

Exception in thread "main" javax.media.opengl.GLException: Error: attempted to make an external GLContext without a valid pixelformat
        at com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext.create(WindowsExternalWGLContext.java:74)
        at com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory.createExternalGLContext(WindowsWGLDrawableFactory.java:197)
        at demos.swt.Snippet209.main(Snippet209.java:83)

What should be a valid pixel format? How should I set it?
Regards,
Martin
ps: I am running on WinXP with a NVidia GeForce 7300.
Reply | Threaded
Open this post in threaded view
|

Re: GLException with SWT Demo

Wade Walker
Administrator
I've seen this on 32-bit Windows XP myself, but haven't tracked it down fully yet. A comment on my tutorial at http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/ said you can work around it like this:

david wrote
import com.jogamp.opengl.impl.windows.wgl.GDI;

insert this line : GDI.GetDC(glcanvas.handle);
after this line: glcanvas.setCurrent();
He apparently found that at http://www.javagaming.org/index.php?action=printpage;topic=21387.0, but there's no bug entry for it yet. I'll look into this and create a bug if needed.
Reply | Threaded
Open this post in threaded view
|

Re: GLException with SWT Demo

Martin
Thanks Wade, that works now. FYI, the javadoc on GLCanvas.handle [0] says:

IMPORTANT: This field is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code.
[0] http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/opengl/GLCanvas.html
Reply | Threaded
Open this post in threaded view
|

Re: GLException with SWT Demo

Wade Walker
Administrator
Martin wrote
IMPORTANT: This field is not part of the SWT public API.
Yeah, this isn't the real solution, it's just a workaround for right now so your development isn't stopped  Once we have a clean solution, I'll post an update here so you can take this workaround out.
Reply | Threaded
Open this post in threaded view
|

Re: GLException with SWT Demo

gouessej
Administrator
In reply to this post by Martin
Don't use this workaround on Linux please.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLException with SWT Demo

Wade Walker
Administrator
In reply to this post by Martin
I finally duplicated this bug on two different Windows XP systems and entered a full bug report at http://jogamp.org/bugzilla/show_bug.cgi?id=429. You should be able to CC yourself on this report to be notified when the bug gets fixed.
Reply | Threaded
Open this post in threaded view
|

Re: GLException with SWT Demo

Martin
Great! Thanks for the CC suggestion. I did it!