JOGL 2 - SWT in MAC : cannot get GLContext

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

JOGL 2 - SWT in MAC : cannot get GLContext

greatdonking
I updated my jars this morning and get execption while trying to get GLContext :
javax.media.openGL.GLException: Error: current Context (CGL) null, no Context (NS)

I do not change anything in my code but...

Any helps would be appreciated :)
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

gouessej
Administrator
Hi

Which JARs were you using just before your latest update? Maybe it is a regression.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

greatdonking
In reply to this post by greatdonking
It seems to be the 2.0-b368-20110419 and jar jogl.all.jar
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

greatdonking
Just try the example JOGL+SWT :
http://jogamp.org/wiki/index.php/Using_JOGL_in_AWT_SWT_and_Swing

and i get the same exception
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

greatdonking
I update my dependencies on maven with 2.0-rc11
withour any success :(
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

greatdonking
I try to compile
src_jogl_classes_com_jogamp_opengl_swt_GLCanvas.java
without success with last JOGL 2rc11 and the last SWT...

Any others ideas ?
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

Sven Gothel
Administrator
On 11/15/2012 11:09 AM, greatdonking [via jogamp] wrote:
> I try to compile
> src_jogl_classes_com_jogamp_opengl_swt_GLCanvas.java
> without success with last JOGL 2rc11 and the last SWT...
>
> Any others ideas ?

Well, the SWT unit tests went through w/ RC11.

<https://jogamp.org/chuck/view/RC/job/jogl-RC/66/>

<https://jogamp.org/chuck/view/RC/job/jogl-RC/66/label=macosx-10_6-x86_64-nvidia/testReport/com.jogamp.opengl.test.junit.jogl.swt/>

Please check the unit tests referenced:
  <http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit/jogl/swt;h=ca3b93e40f9dec1fa08900e448ff481a6a640e93;hb=HEAD>

Please describe your platform as always required for a bug report (Wiki/FAQ/Bug..)
and maybe add a bug report.

~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

greatdonking
In reply to this post by greatdonking
Ok, I understand :)
OS name  mac OS X
version     10.8.2
arch         x86_64
IDE          Eclipse for RCP and RAP Developers, JUNO service release 1, buid id : 20120920-0800

JARS (Maven2 repo):
org.eclipse.swt.cocoa.macosx.x86_64-3.7.2.jar (repo: https://swt-repo.googlecode.com/svn/repo/)
jogl-all-2.0-rc11.jar
gluegen-rt-2.0-rc11.jar

Compilation errors :
The type GLCanvas must implement the inherited abstract method GLAutoDrawable.removeGLEventListener(int)
line 204 : The method disposeGL(GLAutoDrawable, GLDrawable, GLContext, Runnable) in the type GLDrawableHelper is not applicable for the arguments (GLCanvas, GLContextImpl)
...

Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

Sven Gothel
Administrator
On 11/15/2012 02:35 PM, greatdonking [via jogamp] wrote:

> Ok, I understand :)
> OS name  mac OS X
> version     10.8.2
> arch         x86_64
> IDE          Eclipse for RCP and RAP Developers, JUNO service release 1, buid
> id : 20120920-0800
>
> JARS (Maven2 repo):
> org.eclipse.swt.cocoa.macosx.x86_64-3.7.2.jar (repo:
> https://swt-repo.googlecode.com/svn/repo/)
> jogl-all-2.0-rc11.jar
> gluegen-rt-2.0-rc11.jar
>
> Compilation errors :
> The type GLCanvas must implement the inherited abstract method
> GLAutoDrawable.removeGLEventListener(int)
> line 204 : The method disposeGL(GLAutoDrawable, GLDrawable, GLContext,
> Runnable) in the type GLDrawableHelper is not applicable for the arguments
> (GLCanvas, GLContextImpl)
> ...
Please tell us what your are doing, which file fails to compile etc etc.
The above information is not sufficient at all.

It also looks like that you are mixing JOGL RC11 code w/ JOGL post-RC11 code
here, since post RC11 we have changed the GLAutoDrawable and it's Helper ..

~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

greatdonking
I downloaded the GLCanvas file from your site.
Create an JAVA Project in Eclipse, copy your java file plug to maven repository for JOGL 2.0-rc11.
That's all, I have several compilation errors.

It seems that my jars are out of date...
Could you confirm that maven is up to date ?
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

Sven Gothel
Administrator
On 11/15/2012 03:21 PM, greatdonking [via jogamp] wrote:
> I downloaded the GLCanvas file from your site.
> Create an JAVA Project in Eclipse, copy your java file plug to maven
> repository for JOGL 2.0-rc11.
> That's all, I have several compilation errors.
>
> It seems that my jars are out of date...
> Could you confirm that maven is up to date ?

Sorry but this really sounds like chaos to me.

You cannot pick something from the JOGL tree
and compile it against a precompiled thing of the JOGL tree
of even a different version.

Define 'up to date' - The maven repo is on the latest
release RC11. The git repo is ahead of course.

Makes no sense for me .. sorry.

Maybe you just want to pick the unit tests,
copy them for your purpose and test them against RC11 ?

That would be (almost) ok'ish ..

~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

greatdonking
There is no chaos, just a misunderstood

I read this thread
http://forum.jogamp.org/The-Current-State-Of-JOGL-SWT-Integration-td4026329.html

I found this link JOGL's SWT GLCanvas:
http://jogamp.org/git/?p=jogl.git;a=blob;f=src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java;hb=HEAD#l74

My project is a maven2 project with this java source code.
So, if Maven repo is up to date, I conclude that the previous java code source is not valid for the latest release.
In this case , do you have a compliant source code in order to run an SWT IHM with the latest release ?
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

Sven Gothel
Administrator
On 11/15/2012 04:18 PM, greatdonking [via jogamp] wrote:
> There is no chaos, just a misunderstood
>
> I read this thread
> http://forum.jogamp.org/The-Current-State-Of-JOGL-SWT-Integration-td4026329.html
>
> I found this link JOGL's SWT GLCanvas:
> http://jogamp.org/git/?p=jogl.git;a=blob;f=src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java;hb=HEAD#l74
>

.. so far so good.

> My project is a maven2 project with this java source code.
This information is not sufficient.

> So, if Maven repo is up to date, I conclude that the previous java code source
> is not valid for the latest release.
> In this case , do you have a compliant source code in order to run an SWT IHM
> with the latest release ?

"with this hava source code" really gets confusing.

The GLCanvas.java source code is part of JOGL/JogAmp,
compiled, tested and deployed in different ways - maven is one form.

If you include JOGL's maven2 repository, i.e. RC11,
it makes no sense to compile a few JOGL source files against it's pre-build.
Especially not w/ a different version.

Source code for RC11 is part of the JOGL's Maven repository AFAIK
(Mark ?). At least I see source zip archives there.

Another form of deployment for developers is to use/download
the jogamp-all-platforms.7z file which also includes the source code zip archive.

Last but not least, the source code in the git repositories is tagged and signed,
look out for the tag w/ name "v2.0-rc11".

However - you still are not supposed to compile part of JOGL source code
w/ a precompiled JOGL jar file in your classpath.
It's either - or.

Unit tests are ofc a different story and you may cherry pick them for testing
purposes. I may also find the time to re-validate that Wiki SWT test code.

BTW .. I don't know what IHM is.

~Sven

PS: Is Don King really great ? :)


signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

io7m
> Source code for RC11 is part of the JOGL's Maven repository AFAIK
> (Mark ?). At least I see source zip archives there.

Currently these files are empty, unfortunately. They exist solely because the Central repository requires them (they won't let you upload artifacts without source and javadocs jars). Adding real source/javadoc attachments is still on my todo list: Given that the project essentially has one monolithic source zip, and one javadoc zip, it's not really clear to which jar files those should be "attached".
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

Sven Gothel
Administrator
On 11/15/2012 05:38 PM, io7m [via jogamp] wrote:
>> Source code for RC11 is part of the JOGL's Maven repository AFAIK
>> (Mark ?). At least I see source zip archives there.
>
> Currently these files are empty, unfortunately. They exist solely because the
> Central repository requires them (they won't let you upload artifacts without
> source and javadocs jars). Adding real source/javadoc attachments is still on
> my todo list: Given that the project essentially has one monolithic source
> zip, and one javadoc zip, it's not really clear to which jar files those
> should be "attached".

You know .. we have the java-only source zip artifacts,
which belong to the java only 'all' targets (I assume).

The javadoc is IMHO irrelevant .. since IDE's can use the source attachments
and produce the proper hover and javadoc help.

~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

io7m
Sorry, I'm an idiot. I somehow missed those *-java-src zip files. That's that problem solved, then.

I'll modify the scripts to require the *-javadoc.7z files as input too.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

Sven Gothel
Administrator
On 11/15/2012 05:49 PM, io7m [via jogamp] wrote:
> Sorry, I'm an idiot.
Pls don't say that - you are the hero of all jogamp maven users!

> I somehow missed those *-java-src zip files. That's that
> problem solved, then.
>
> I'll modify the scripts to require the *-javadoc.7z files as input too.
You may add those as well, still - they might be redundant - your choice ofc!

~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

Brian Capozzi
In reply to this post by greatdonking
I have the same exact issue on Mac OS X 10.8.2.

Just migrated to jogl-2.0-rc11 from 1.1

After downloading the source for jogl-2.0-rc11 and stepping through it, the problem appears tied to the following as I trace through the call to create the context:

GLProfile.initSingleton();
final GLProfile gl2Profile = GLProfile.get(GLProfile.GL2);
glContext = GLDrawableFactory.getFactory(gl2Profile).createExternalGLContext();

The factory that gets used is the nativeOS drawable factory.  

The stack trace looks like:

MacOSXExternalCGLContext.create(GLDrawableFactory) line: 92
MacOSXAWTCGLDrawableFactory(MacOSXCGLDrawableFactory).createExternalGLContextImpl() line: 395 [local variables unavailable]
MacOSXAWTCGLDrawableFactory(GLDrawableFactoryImpl).createExternalGLContext() line: 446 [local variables unavailable]

Looking at the call to create():

protected static MacOSXExternalCGLContext create(GLDrawableFactory factory) {
    long pixelFormat = 0;
    long currentDrawable = 0;
    long contextHandle = CGL.getCurrentContext();
    ...

This static method returns 0.  As does the next call in the else branch:

contextHandle = CGL.CGLGetCurrentContext();

At which point, an exception is thrown:

if (contextHandle == 0) {
          throw new GLException("Error: current Context (CGL) null, no Context (NS)");
        }

Any idea what is wrong here?  What can I do to provide you with additional input?

Thanks,
BC
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

Brian Capozzi
It should be noted that the same code running on a windows box (Windows 7, SP1) runs without issue.  So it appears to be something specific to mac os x.  I have not yet tried linux.  But will.
Reply | Threaded
Open this post in threaded view
|

Re: JOGL 2 - SWT in MAC : cannot get GLContext

gouessej
Administrator
In reply to this post by Brian Capozzi
Hi

Which graphics card and which driver do you use?
Julien Gouesse | Personal blog | Website
12