Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (542)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (605)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Adding JOGL into an Existing Netbeans Project  (Read 2791 times)
0 Members and 1 Guest are viewing this topic.
Offline AI Guy

Senior Newbie





« Posted 2007-11-05 18:28:11 »

I have an existing Project, created a long ago, and I want to add JOGL into it, so I do not have to throw away all my CVS history, or make two projects.  I added the JOGL library to the project properties.  The line new GLCanvas(); throws  java.lang.NoClassDefFoundError: com/sun/gluegen/runtime/DynamicLookupHelper

I then added the gluegen-rt library into the project to see what would happen, even though a brand new Simple JOGL project does not have it.  Now the error is java.lang.UnsatisfiedLinkError: no jogl in java.library.path.

I can run the Simple JOGL project that comes with the Netbeans OpenGL plugin. I can add the line new GLCanvas(); to main(), and everything works fine.  When looking at it's projects properties, it just shows JOGL, but there is an error down at the bottom of the dialog box, say "Some library items cannot be located".

Are there any directions to modifying an existing project to do this, or should I reverse engineer it, looking at simple JOGL's proect files?

Offline AI Guy

Senior Newbie





« Reply #1 - Posted 2007-11-05 19:15:14 »

More info:  The Run tab of the Simple JOGL Library shows the error.  it looks something like:
Broken reference: ${javac.classpath}${path.separator}${build.classes.dir}

Looking at the project.properties file for Simple OpenGL, found these unique lines:

natives.platform=macosx-universal
...
run-sys-prop.java.library.path=\
    ${libs.JOGL.classpath}-natives-${natives.platform}${path.separator}\
    ${libs.GLUEGEN-RT.classpath}-natives-${natives.platform}

Assuming everything was backed up first.  What I think I am going to try first is add all my references into a simple OpenGL project, then the minimal changes so it can can replace my old project.properties, and see if it works.

Wondering if Netbeans OpenGL projects need changing inorder to develop between native platforms?
Offline cylab

JGO Ninja


Medals: 56



« Reply #2 - Posted 2007-11-05 19:33:25 »

The missing dependency in the libraries node and the broken reference message are minor bugs of the prerelease in beta 1 and 2.

For the UnsatisfiedLinkError, you could try to simple update your project.properties with the natives.platform and  run-sys-prop.java.library.path from the SimpleJOGL project.

For development between platforms, you have to override this settings in your projects private folder.

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline AI Guy

Senior Newbie





« Reply #3 - Posted 2007-11-05 20:37:39 »

Tried it my way first even though there are more changes.  Many can be done with with the IDE,  the manual ones are dealing with things I understand.  It gets a lot farther, probably beyond this threads scope.  It produced a java.libray.path of:
.netbeans/6.0beta2/libs/jogl.jar-natives-macosx-universal:
.netbeans/6.0beta2/libs/gluegen-rt.jar-natives-macosx-universal

Did die with a Java Result: 138.  MacOS then brought up a dialog to report it.  I am going to hold off on that.  I am probably commiting some atrocities, and just now able to get that far.
Offline cylab

JGO Ninja


Medals: 56



« Reply #4 - Posted 2007-11-05 20:45:08 »

So... the java result 138 is your fault or ours?  Roll Eyes

Mathias - I Know What [you] Did Last Summer!
Offline AI Guy

Senior Newbie





« Reply #5 - Posted 2007-11-05 21:22:59 »

you tell me.  For error isolation purposes I did the following to a fresh simple JOGL:

put the lines
            GLCanvas can = new GLCanvas();
            GLContext con = can.createContext(null);
            GL gl = con.getGL();

            gl.isExtensionAvailable("GL_ARB_fragment_program");

right at the front.  The isExtensionAvailable produced the abort.

I did the same thing on Win/XP & Netbeans 6.0 beta 1, with a Simple JOGL created on that machine.  This time I got just an illegal Argument exception.  Clearly I am doing something wrong,  but the MacOS response does seem a little harsh.
Offline cylab

JGO Ninja


Medals: 56



« Reply #6 - Posted 2007-11-05 21:58:46 »

Ah, OK. Not our fault  Tongue (we are only producing the NetBeans plugin)

You have to call GL functions at a time where the GL context is current. Best would be to use the GLEventListener mechanism and check extensions in the init() callback.

Alternatively you could call afaik makeCurrent() yourself.
http://ls7-www.cs.uni-dortmund.de/students/lectures/doc_mmi0708/puebungen/jogl-1_0_0-docs/javax/media/opengl/GLContext.html

Mathias - I Know What [you] Did Last Summer!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Elsealabs (16 views)
2014-12-28 10:39:27

CopyableCougar4 (20 views)
2014-12-28 02:10:29

BurntPizza (25 views)
2014-12-27 22:38:51

Mr.CodeIt (15 views)
2014-12-27 04:03:04

TheDudeFromCI (20 views)
2014-12-27 02:14:49

Mr.CodeIt (26 views)
2014-12-23 03:34:11

rwatson462 (58 views)
2014-12-15 09:26:44

Mr.CodeIt (47 views)
2014-12-14 19:50:38

BurntPizza (96 views)
2014-12-09 22:41:13

BurntPizza (115 views)
2014-12-08 04:46:31
How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!