Jogl API Overview

Before starting, you should know that the JOGL API is not a young API, this means that there are some things that are (very) old, so you should always evaluate what you are looking at.

We will reference the links giving the priority to the main jogamp server, but you can click also on the GitHub version (GH) for a better layout, font and support for highlighting or on the API docs (AD).

Preface

The JOGL API offers a lots of deep and detailed utilities for almost all the possible needs regarding OpenGL but most of them aren't used simply because people ignore about their existence. This small overview aims to alleviate this problem.

You can find the most interesting part under com.jogamp.opengl (GH).

Shaders

com.jogamp.opengl.util.glsl (GH).

You can create your own GLSL program in JOGL by simply calling:

You can init vertex, fragment, geometry, tesselation control and tesselation evaluation shaders (compute will be implemented soon) using ShaderCode.create (GH AD). For the vertex shader, note that  is the name and "vert" is the custom suffix. You need to specify that if your shaders suffices differ from these.

The two  refer to the path for the binary shaders and the name. If the shaders are located in the same package of the  you can pass    also on the src path.

Then you can create the class ShaderProgram, but please note that this has nothing to do with OpenGL, it is just Java side.

Finally we can add the created shaders into our Program and link it. This last call is important because it is here that our program will be initialized on OpenGL and linked.

The function will also check at the end if everything went fine or not.

Please note that the program id/name is obtained through the program method, the method has nothing to do with it.

API docs: ShaderCode ShaderProgram ShaderState ShaderUtil

Textures