NewtCanvasSWT problem
Posted by stefano.cottafavi on Dec 19, 2013; 5:42pm
URL: https://forum.jogamp.org/NewtCanvasSWT-problem-tp4030973.html
Hi,
I'm trying NewtCanvasSWT inside an Eclipse ViewPart. I'm on Mac OS X 10.9.1
I've Jogl 2.1.3 plugin made following Wade's tutorial (+ the addition of Require-Bundle: org.eclipse.swt)
I'm still facing the fact that no context can be obtained with the following code
public void createPartControl(Composite parent) {
GLProfile glprofile = GLProfile.getDefault();
GLCapabilities caps = new GLCapabilities(glprofile);
GLWindow glWindow1 = GLWindow.create(caps);
composite = new Composite( parent, SWT.NONE );
composite.setLayout( new FillLayout() );
glcanvas = new NewtCanvasSWT( composite, SWT.NO_BACKGROUND, glWindow1 );
GLDrawableFactory gldf = GLDrawableFactory.getFactory( glprofile );
glcontext = gldf.createExternalGLContext();
last line fails with
SWTAccessor.<init>: GTK Version: 0.0.0
!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-12-19 18:27:40.048
!MESSAGE
!STACK 0
javax.media.opengl.GLException: Error: current Context (CGL) null, no Context (NS)
at jogamp.opengl.macosx.cgl.MacOSXExternalCGLContext.create(MacOSXExternalCGLContext.java:91)
at jogamp.opengl.macosx.cgl.MacOSXCGLDrawableFactory.createExternalGLContextImpl(MacOSXCGLDrawableFactory.java:384)
at jogamp.opengl.GLDrawableFactoryImpl.createExternalGLContext(GLDrawableFactoryImpl.java:501)
at sc.ndt.aml.view.JOGLTestNewt.createPartControl(JOGLTestNewt.java:66)
I have no clue on what's going on?! any help will be appreciated
cheers
stefano