aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl/gl-impl-CustomJavaCode-common.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-11 15:33:10 +0100
committerSven Gothel <[email protected]>2015-03-11 15:33:10 +0100
commit68391b118e93170c568edc21edad7f6b0c1f97a3 (patch)
treec0fd4e18d0bca4f1ca0875bf2d1d0df430afd09d /make/config/jogl/gl-impl-CustomJavaCode-common.java
parentcd92c17175db0c3a3a04b5b327cfcb887bf8a7d7 (diff)
Bug 1135: Complete GLBufferObjectTracker for GL 4.5 using GlueGen's DelegateImplementation/ReturnsOpaque (Bug 1144)
Using GlueGen's new DelegateImplementation/ReturnsOpaque feature (Bug 1144) allows us to drop manually C implementation stubs, while simply delegating into the renamed private generated variant using the manual stub. Completed glBufferStorage and glNamedBufferStorage for GL 4.4 while subsuming DSA's of GL 4.5 and GL_EXT_direct_state_access (only the single functions, otherwise extension is not compatible).
Diffstat (limited to 'make/config/jogl/gl-impl-CustomJavaCode-common.java')
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-common.java49
1 files changed, 29 insertions, 20 deletions
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-common.java b/make/config/jogl/gl-impl-CustomJavaCode-common.java
index 503c125f0..6ecb886b7 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-common.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-common.java
@@ -136,52 +136,61 @@
private final GLBufferObjectTracker bufferObjectTracker;
private final GLBufferStateTracker bufferStateTracker;
+ @Override
+ public final void glBufferData(int target, long size, Buffer data, int usage) {
+ bufferObjectTracker.createBufferStorage(bufferStateTracker, this,
+ target, size, data, usage, 0 /* immutableFlags */,
+ createBoundMutableStorageDispatch);
+ }
private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch createBoundMutableStorageDispatch =
new jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch() {
- public final void create(final int target, final long size, final Buffer data, final int mutableUsage, final long glProcAddress) {
- final boolean data_is_direct = Buffers.isDirect(data);
- dispatch_glBufferData(target, size,
- data_is_direct ? data : Buffers.getArray(data),
- data_is_direct ? Buffers.getDirectBufferByteOffset(data) : Buffers.getIndirectBufferByteOffset(data),
- data_is_direct, mutableUsage, glProcAddress);
+ public final void create(final int target, final long size, final Buffer data, final int mutableUsage) {
+ glBufferDataDelegate(target, size, data, mutableUsage);
}
};
- private native void dispatch_glBufferData(int target, long size, Object data, int data_byte_offset, boolean data_is_direct, int usage, long procAddress);
+ @Override
+ public boolean glUnmapBuffer(int target) {
+ return bufferObjectTracker.unmapBuffer(bufferStateTracker, this, target, unmapBoundBufferDispatch);
+ }
private final jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch unmapBoundBufferDispatch =
new jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch() {
- public final boolean unmap(final int target, final long glProcAddress) {
- return dispatch_glUnmapBuffer(target, glProcAddress);
+ public final boolean unmap(final int target) {
+ return glUnmapBufferDelegate(target);
}
};
- private native boolean dispatch_glUnmapBuffer(int target, long procAddress);
@Override
public final java.nio.ByteBuffer glMapBuffer(int target, int access) {
return mapBuffer(target, access).getMappedBuffer();
}
-
@Override
- public final ByteBuffer glMapBufferRange(int target, long offset, long length, int access) {
- return mapBufferRange(target, offset, length, access).getMappedBuffer();
+ public final GLBufferStorage mapBuffer(final int target, final int access) {
+ return bufferObjectTracker.mapBuffer(bufferStateTracker, this, target, access, mapBoundBufferAllDispatch);
}
-
private final jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch mapBoundBufferAllDispatch =
new jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch() {
public final ByteBuffer allocNioByteBuffer(final long addr, final long length) { return newDirectByteBuffer(addr, length); }
- public final long mapBuffer(final int target, final int access, final long glProcAddress) {
- return dispatch_glMapBuffer(target, access, glProcAddress);
+ public final long mapBuffer(final int target, final int access) {
+ return glMapBufferDelegate(target, access);
}
};
- private native long dispatch_glMapBuffer(int target, int access, long glProcAddress);
+ @Override
+ public final ByteBuffer glMapBufferRange(int target, long offset, long length, int access) {
+ return mapBufferRange(target, offset, length, access).getMappedBuffer();
+ }
+ @Override
+ public final GLBufferStorage mapBufferRange(final int target, final long offset, final long length, final int access) {
+ return bufferObjectTracker.mapBuffer(bufferStateTracker, this, target, offset, length, access, mapBoundBufferRangeDispatch);
+ }
private final jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch mapBoundBufferRangeDispatch =
new jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch() {
public final ByteBuffer allocNioByteBuffer(final long addr, final long length) { return newDirectByteBuffer(addr, length); }
- public final long mapBuffer(final int target, final long offset, final long length, final int access, final long glProcAddress) {
- return dispatch_glMapBufferRange(target, offset, length, access, glProcAddress);
+ public final long mapBuffer(final int target, final long offset, final long length, final int access) {
+ return glMapBufferRangeDelegate(target, offset, length, access);
}
};
- private native long dispatch_glMapBufferRange(int target, long offset, long length, int access, long glProcAddress);
private native ByteBuffer newDirectByteBuffer(long addr, long capacity);
+