JGLOOm stands for Java openGL: Object Oriented (man!) it is Java library that wraps the functionality of the OpenGL API in a more object-oriented package. It puts OpenGL objects into Java interfaces, and their functions into static factories / container utils, allowing for code to be reactive to the user’s OpenGL version/platform dependency. It also provides users higher-level utilities like tracker objects that follow OpenGL values (like a texture parameter) around, reducing API calls.
Repository for loading file formats into those objects (no work has been done here yet)
https://github.com/team-jgloom/jgloom
Currently the library is in pre-production and we’re working on the standard for it. Here’s some stuff we have done though:
GLBuffers - Interface and LWJGL Containers
GLTextures - Interface and LWJGL Containers
GLFrameBuffers - Interface and LWJGL Containers
GLRenderBuffers - Interface and LWJGL Containers
GLSLShaders - Interface and LWJGL Containers
GLSLPrograms - Interface and LWJGL Containers
LWJGL Specific:
GLFWWindows - Interface and LWJGL Containers
GLFWMonitors - Interface and LWJGL Containers
Here’s how an object looks in our library
public interface GLBuffer {
/** @return The identifier for the buffer object */
int getBuffer();
}
The focus of this library was not just the higher-level manipulation of OpenGL objects, but also loading popular file formats such as these:
Image formats
- JPEG
- PNG
- TIFF
- GIF
- BMP
Model formats (Planned)
- MD5 - Animations and all
- OBJ
- FBX
- Collada - We intend to use JCollada
- Blend - In the very far future, as a tech demo (it would be very hard)
Behold the power of the higher level!
Lambdas:
public GLBuffer getMyBuffer(){
int buffer = GL15.glGenBuffers();
return () -> buffer;
}
Texture Loading into WebGL, JOGL, and LWJGL all at once!
// GLFTextureImage2D is a group of functions that represent an OpenGL texture that supports Image2D.
// It's class extends from GLFTexture, with defines basic functions like bind and delete
// Containers implement these functions as a sign of what their library supports (some libraries might not support GLFTextureImage3D for example)
TextureLoader.load(GLFTextureImage2D, InputStream)
// LWJGL's textures, as well as WebGL, JOGL and everything else supports Image2D, so their supported in their containers:
GLTextureContainer lwjglTexture = new GLTextureContainer(LWJGLTextures.createTexture())
JGLTextureContainer joglTexture = new JGLTextureContainer(JOGLTextures.createTexture())
WGLTextureContainer webTexture = new WGLTextureContainer(WGLTextures.createTexture())
TextureLoader.load(lwjglTexture, new FileInputStream(...));
TextureLoader.load(joglTexture, new FileInputStream(...));
TextureLoader.load(lwebTexture, new FileInputStream(...));
What we’re working on now is just that but with 3D models :persecutioncomplex:
More examples to come.