-------------------------------------------------------------------------------------------------------------------------------

http://www.3dcpptutorials.sk/

-------------------------------------------------------------------------------------------------------------------------------

Java OpenGL Native Interface

-------------------------------------------------------------------------------------------------------------------------------

Warning

This is an experimental project. It's purpose is to make it easier to rewrite our C/C++ OpenGL tutorials to Java. Our native DLL doesn't provide all OpenGL functions and it works only with 32-bit Java on Windows.

-------------------------------------------------------------------------------------------------------------------------------

Download and install

Java SE Development Kit 8u25 (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
NetBeans IDE 8.0.2 Java SE (https://netbeans.org/downloads/index.html)

We downloaded and installed

jdk-8u25-windows-i586.exe
jdk-8u25-windows-x64.exe
netbeans-8.0.2-javase-windows.exe

-------------------------------------------------------------------------------------------------------------------------------

NetBeans

On 64-bit Windows you must set the NetBeans default JDK the 32-bit one, because our native DLL is 32-bit.

You can change the NetBeans default JDK in the C:\Program Files\NetBeans 8.0.2\etc\netbeans.conf file.

netbeans_jdkhome="C:\Program Files (x86)\Java\jdk1.8.0_25"

-------------------------------------------------------------------------------------------------------------------------------

Visual Studio

In Tools -> Options -> Projects and Solutions -> VC++ Directories

add

C:\Program Files (x86)\Java\jdk1.8.0_25\include
C:\Program Files (x86)\Java\jdk1.8.0_25\include\win32

to the Directories for Include files

and

C:\Program Files (x86)\Java\jdk1.8.0_25\lib

to the Directories for Library files.

-------------------------------------------------------------------------------------------------------------------------------

Native Win32 DLL

The joglni.dll is built in Visual Studio and requires GLEW.

After you build your own joglni.dll (in Visual Studio), you must copy it (from the \native-source-vs2008\joglni\Release directory) to the root directory of your Java application's NetBeans project (\java-application-example-netbeans\FirstJOGLNIApplication).

-------------------------------------------------------------------------------------------------------------------------------

Java class library

If you add or change any native functions in the joglni.dll, don't forget to change and build the joglni.jar (in NetBeans) appropriately.

After you build your own joglni.jar, you must copy it (from the \java-class-library-netbeans\joglni\dist directory) to the lib directory of your Java application's NetBeans project (\java-application-example-netbeans\FirstJOGLNIApplication\lib).

-------------------------------------------------------------------------------------------------------------------------------

First JOGLNI application

If you change the joglni.jar, don't forget to rebuild your Java application (\java-application-example-netbeans\FirstJOGLNIApplication) in NetBeans.

-------------------------------------------------------------------------------------------------------------------------------
