The LWJGL API is not a direct call to openGL, everywhere I look that there is a small layer of abstraction, I think that is why it is called light weight.
Most of the abstraction is similar, for example, the code in this example is common throughout the source
public static void glBufferSubData(int target, long offset, FloatBuffer data) { ContextCapabilities caps = GLContext.getCapabilities(); long function_pointer = caps.glBufferSubData; BufferChecks.checkFunctionAddress(function_pointer); BufferChecks.checkDirect(data); nglBufferSubData(target, offset, (data.remaining() << 2), MemoryUtil.getAddress(data), function_pointer); }
As you can see, the LWJGL user will call this function, and then this function will call the actual GL function. I assume that the "n" in nglBufferSubData means native.
So my question is: what does this code mean? I have an idea what this function does. It sends data to an openGL buffer object. I just donβt understand what is happening in the code. Can anyone break this for me?
source share