summaryrefslogtreecommitdiffstats
path: root/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-06-10 14:28:03 +0200
committerMichael Bien <[email protected]>2010-06-10 14:28:03 +0200
commit2522d4f1ebffec030d7e8c3688e5f952c574c3d0 (patch)
tree81d631cb11dadc483a4615996dedf773eed083da /make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
parent57d3d3f9f9475ae167cd9d33c9450eea66439fd2 (diff)
parent1d333a771ce0bc7c8594e21d031703f698f06a46 (diff)
Merge branch 'master' of github.com:sgothel/jogl
Diffstat (limited to 'make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java')
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java34
1 files changed, 29 insertions, 5 deletions
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
index bceb12fe5..aa176738a 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
@@ -308,19 +308,20 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) {
if (__addr_ == 0) {
throw new GLException("Method \"glMapBuffer\" not available");
}
- int sz = bufferSizeTracker.getBufferSize(bufferStateTracker,
- target,
- this);
+ int sz = bufferSizeTracker.getBufferSize(bufferStateTracker, target, this);
+ if (0 == sz) {
+ return null;
+ }
long addr;
addr = dispatch_glMapBuffer(target, access, __addr_);
- if (addr == 0 || sz == 0) {
+ if (0 == addr) {
return null;
}
ARBVBOKey key = new ARBVBOKey(addr, sz);
ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key);
if (_res == null) {
_res = newDirectByteBuffer(addr, sz);
- InternalBufferUtil.nativeOrder(_res);
+ Buffers.nativeOrder(_res);
arbVBOCache.put(key, _res);
}
_res.position(0);
@@ -330,6 +331,29 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) {
/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
native private long dispatch_glMapBuffer(int target, int access, long glProcAddress);
+/** Entry point to C language function: <code> GLvoid * {@native glMapNamedBufferEXT}(GLuint buffer, GLenum access); </code> <br>Part of <code>GL_EXT_direct_state_access</code> */
+public java.nio.ByteBuffer glMapNamedBufferEXT(int buffer, int access) {
+ final long __addr_ = ((GL4bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapNamedBufferEXT;
+ if (__addr_ == 0) {
+ throw new GLException("Method \"glMapNamedBufferEXT\" not available");
+ }
+ int sz = bufferSizeTracker.getDirectStateBufferSize(buffer, this);
+ if (0 == sz) {
+ return null;
+ }
+ long addr;
+ addr = dispatch_glMapNamedBufferEXT(buffer, access, __addr_);
+ if (0 == addr) {
+ return null;
+ }
+ ByteBuffer _res = newDirectByteBuffer(addr, sz);
+ Buffers.nativeOrder(_res);
+ _res.position(0);
+ return _res;
+}
+
+private native long dispatch_glMapNamedBufferEXT(int buffer, int access, long procAddress);
+
native private ByteBuffer newDirectByteBuffer(long addr, int capacity);
/** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */