JOGL Project Template available for NetBeans

[s]I have just finished a first version of a JOGL project template as extension module. Momentarily it is only functional on Windows

You can download it here:
http://cylab.codewut.de/nbms/50/net-highteq-gamedev-nbm-joglproject.nbm

or you could also add an Autoupdate-Center for my modules, since there is more to come (GLSL-Editor, more Demos, etc.)
http://cylab.codewut.de/nbms/50.xml

Tools->Options->[AdvancedOptions]
(+)IDE Configuration
(+)System
(+)Autoupdate Types

Add a new “General Update Center” via right click context menu and change the Server URL on the new entry to the above

Any comments are welcome!
[/s]

Edit: This project was replaced by it’s successor, the Netbeans OpenGL Pack. See some screenshots here

Have fun!

Hi,

I’m quite afraid, not for security but for update issues, to install a plug-in with a specific version of jogl.
But it’s sure that this kind of plug-in could really improve the easiness of starting a new project with jogl.

Good job!

Thanks for comment.

I plan to keep the plugin up to date with the current JOGL releases. The JOGL jars/natives are not part of the project template. They are copied from the module installation location to your apps distibution binaries during the build process. So JOGL projects based on this template will get updated automatically whith each plugin update.

Maybe there should be an option to disable this behaviour and create a project tree that contain all libraries and natives, so that developer can keep and update specific JOGL versions, if they want/need to.

I forget to mention, that the plugin does NOT install anything anywhere inside your JRE/JDK or PATH environment. You are absolutely save to install this module without breaking your system’s setup.

This isn’t really related but I asked the JSR 198 expert group about loading native libraries and managing native dependencies with JSR 198, the Java IDE standard because I someday may want to use JOGL in a plugin. Here is the response I got:

[quote]As I said in my previous reply to your question
the JSR does not provide a standard way to
to define dependencies to native libraries.

What the JSR provides is an API clients can call to
get their extension path: ExtensionRegistry.getInstallRoot().
This API can be used to get at the directory where
your native library resides as follows:

import javax.ide.extension.ExtensionRegistry;
import javax.ide.net.URIFactory;
import javax.ide.net.VirtualFileSystem;

final Extension myExt = 
       ExtensionRegistry.getExtension("my.extension");

final URI extPath = ExtensionRegistry.getInstallRoot(myExt);

final URI libPath = URIFactory.newURI(extPath, "lib");

final String path = 

URIVirtualFileSystem.getPlatformPathName(libPath);

Now you can use the System.loadLibrary( path )
method call to load your native library.

You also must take care to package
your extension into a JSR 198 extension bundle archive
(EBA), and to place your files as specified by the EBA
specification:

- my.extension.jar            => extension jar
- my.extension                => extension directory must have 
                                          same name as extension 

jar.
- my.extension\lib\my.dll => native library

The EBA is installed in an IDE’s extensions directory.

I hope this answers your question.

Jose.
[/quote]
I am not too familar with the latest open IDE API but if it support file paths for modules then the above approach my work for managing JOGL version dependencies

The project template described above is to develop a standalone java application and not to develop a netbeans plugin. It’s only that the template can be deployed using the netbeans module mechanism.

I have however written a library module for use in netbeans plugins as well. It was quite easy, since there is a special purpose folder in a module that gets added to the java.library.path automatically. I will upload this to my update-center soon.

Nevertheless your quote is an insightful contribution, since I was not aware of the JSR 198.

Theres an update available:

Please have a look and report success or problems on other platforms than windows => Thanks!

NOTE: Projects created with the previous version do not work after this update.
I recommend creating a new project and copying the contents of your “src” folder to it.

hi there…thanks so much for the info!! I did what you suggested, and downloaded netbeans and set an auto config to your URL…yay! so, now, can you please tell me more about properly using it… is there JOGL documentation available?

bernie

JOGL is more or less the same than C/C++ OpenGL, so there is no special documentation available. See http://nehe.gamedev.net/ for general OpenGL tutorials. Most of them contain a JOGL or GL4Java (some kind of JOGL predecessor) port. There are some more recent ports of the lessons at http://pepijn.fab4.be/nehe/ like Ken already pointed out at the other Thread.

I would however suggest to follow the instructions and try to recode the interesting lessons there by yourself to get a feeling for JOGL.
At first just try to copy and paste your C++ code and add a “gl.” before each OpenGL-Call. The IDE will shriek if somethings not right :wink:

thanks so much

I am new to NetBeans and would like to utilize your template for JOGL. Could you please explain how to use your template.

Thanks.

To Install the plugin

  • Follow the instructions in the first post to register a new update center
  • Go to “Tools”->“Update Center”
  • Make sure the checkbox of the newly created update center is selected
  • Select “OpenGL / JOGL OpenGL project” and optionally “OpenGL / JOLG OpenGL demo project” and click [ Add > ]
  • Click [ Next > ] and accept the licence agreements
  • Click [ Next > ] once the download is finished
  • Include the downloaded modules in the install by checking the checkboxes at the left
  • Click [ Yes ] at the “Untrusted Modules” warning (I haven’t signed the modules yet…)
  • Click [ Finish ] and allow the IDE to restart

[b]After the restart you can create a new JOGL-Project doing the following:[b]

  • Choose “File”->“New Project”
  • Select Category “OpenGL” and Project: “Simple JOGL Appplication”
  • Click [ Next > ], change the desired fields in the next form and click [ Finish ]

Now your Project is set and you can click the “Play”-Button in the Toolbar and see what happens.

After the first run examine the generated .java file under the “Source Packages” folder, change something and hit “Play” again.

You can generate distributions of your application for all JOGL supported platforms by clicking the “Build Main Project” button
(the blue one with the wrench symbol). You can examine the results by changing to the “Files” view.

Happy coding

Thanks, that comile fine, but I get:

Exception in thread “main” java.lang.UnsatisfiedLinkError: no jogl in java.library.path

I assume this has to do with the win32 dlls fo JOGL? Any suggestions?

You shouldn’t get that error, since the dlls are included.
Could you please create a new project and post the content of the output console just after clicking [ Finish > ]

Also post the output console content after compile. Thanks

“Could you please create a new project and post the content of the output console just after clicking [ Finish > ]”

initProject:
Created dir: C:\Documents and Settings\rodgersgb\Test2Opengl\tmp
Expanding: C:\Program Files\netbeans-5.0\nb5.0\jogl-project\jogl-templates.zip into C:\Documents and Settings\rodgersgb\Test2Opengl\tmp
Created dir: C:\Documents and Settings\rodgersgb\Test2Opengl\src\org\yourorghere
Moving 1 file to C:\Documents and Settings\rodgersgb\Test2Opengl\src\org\yourorghere
Moving 1 file to C:\Documents and Settings\rodgersgb\Test2Opengl\src\org\yourorghere
Deleting directory C:\Documents and Settings\rodgersgb\Test2Opengl\tmp
addDeps:
BUILD SUCCESSFUL (total time: 0 seconds)

“Also post the output console content after compile. Thanks”

init:
deps-jar:
Created dir: C:\Documents and Settings\rodgersgb\Test2Opengl\build\classes
Compiling 1 source file to C:\Documents and Settings\rodgersgb\Test2Opengl\build\classes
compile:
Created dir: C:\Documents and Settings\rodgersgb\Test2Opengl\dist
Building jar: C:\Documents and Settings\rodgersgb\Test2Opengl\dist\Test2Opengl.jar
To run this application from the command line without Ant, try:
java -jar “C:\Documents and Settings\rodgersgb\Test2Opengl\dist\Test2Opengl.jar”
Creating native distibutions
Created dir: C:\Documents and Settings\rodgersgb\Test2Opengl\dist-linux
C:\Documents and Settings\rodgersgb\Test2Opengl\build.xml:75: C:\WINDOWS\system32\jogl-natives-linux not found.
BUILD FAILED (total time: 0 seconds)

I see that its assuming linux. Also, I downloaded the JOGL libs (I am using windows). Do the dlls need to be put in the system32 dir?

Thanks.

No, you don’t need any additional libs beside the module. Just delete the created projects, create a new one and select “Windows” as platform in the projects creation dialog.

It did have “Windows” selected as the Platform. I just tried it again with “Windows” chosen as the platform. Same results.

For some reason it is assuming linux.

After rereading your post, I am afraid, recreating the project will not help. Could you please zip a newly created project and send it to cylabhighteqnet ( and replaced respectively)

Is this server still up? I can’t get it to show any packages in NetBeans, and if I try using the browser, I get a 502 error…

Sorry. My tomcat crashed :-/
Thanks for pointing out. It’s up again.
I will release an update this weekend including jogl-jsr-beta4, some more examples and a simple glsl syntax colorizing editor.

hi,
Thank you very much.
I have searched for a long time to use nb to develop the jogl.
you give me a big help !