summaryrefslogtreecommitdiffstats
path: root/make/gl-impl-CustomJavaCode.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2004-04-22 03:37:57 +0000
committerKenneth Russel <[email protected]>2004-04-22 03:37:57 +0000
commit9512c9fa62ece3960472b6ab2cd6ce5244da8501 (patch)
tree87112d7ade6b1ec2fd364f77012838cde49b9c7b /make/gl-impl-CustomJavaCode.java
parent6ea7e2388164abd26aa8a88ffe615fb6e7780ee6 (diff)
Added OpenGL 1.5 support. Updated glext.h, wglext.h, and glxext.h from
extension registry; these now include only very few changes relative to the master version. Fixed bugs in GlueGen and PCPP to make it parse the verbatim headers and to emit correct glue code for some newly-exercised constructs like char**. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@115 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/gl-impl-CustomJavaCode.java')
-rw-r--r--make/gl-impl-CustomJavaCode.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/make/gl-impl-CustomJavaCode.java b/make/gl-impl-CustomJavaCode.java
index 152458b5b..a4709fde4 100644
--- a/make/gl-impl-CustomJavaCode.java
+++ b/make/gl-impl-CustomJavaCode.java
@@ -25,6 +25,29 @@ private static class ARBVBOKey {
private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap();
+/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+public java.nio.ByteBuffer glMapBuffer(int target, int access) {
+ final long __addr_ = _context.getGLProcAddressTable()._addressof_glMapBuffer;
+ if (__addr_ == 0) {
+ throw new GLException("Method \"glMapBuffer\" not available");
+ }
+ int[] sz = new int[1];
+ glGetBufferParameteriv(target, GL_BUFFER_SIZE_ARB, sz);
+ long addr;
+ addr = dispatch_glMapBuffer(target, access, __addr_);
+ if (addr == 0 || sz[0] == 0) {
+ return null;
+ }
+ ARBVBOKey key = new ARBVBOKey(addr, sz[0]);
+ ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key);
+ if (_res == null) {
+ _res = InternalBufferUtils.newDirectByteBuffer(addr, sz[0]);
+ _res.order(ByteOrder.nativeOrder());
+ arbVBOCache.put(key, _res);
+ }
+ return _res;
+}
+
/** Entry point to C language function: <br> <code> LPVOID glMapBufferARB(GLenum target, GLenum access); </code> */
public java.nio.ByteBuffer glMapBufferARB(int target, int access) {
final long __addr_ = _context.getGLProcAddressTable()._addressof_glMapBufferARB;
@@ -48,5 +71,8 @@ public java.nio.ByteBuffer glMapBufferARB(int target, int access) {
return _res;
}
+/** 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);
+
/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBufferARB(GLenum target, GLenum access); </code> */
native private long dispatch_glMapBufferARB(int target, int access, long glProcAddress);