From 1f70418d2dea8705e4453fbecc123c58e92b4b68 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 20 Dec 2006 19:21:35 +0000 Subject: [PATCH] Make glGetBufferPointer and glMapBuffer in GL15 and ARB_buffer_object compute result_size automatically. Change NV_vertes_array_range to use the new AutoResultSize syntax. --- src/templates/org/lwjgl/opengl/ARB_buffer_object.java | 2 ++ src/templates/org/lwjgl/opengl/GL15.java | 2 ++ src/templates/org/lwjgl/opengl/NV_vertex_array_range.java | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/templates/org/lwjgl/opengl/ARB_buffer_object.java b/src/templates/org/lwjgl/opengl/ARB_buffer_object.java index 5a6c782a..8e074a5e 100644 --- a/src/templates/org/lwjgl/opengl/ARB_buffer_object.java +++ b/src/templates/org/lwjgl/opengl/ARB_buffer_object.java @@ -116,6 +116,7 @@ public interface ARB_buffer_object { */ @CachedResult @GLvoid + @AutoResultSize("GLChecks.getBufferObjectSizeARB(caps, target)") ByteBuffer glMapBufferARB(@GLenum int target, @GLenum int access); boolean glUnmapBufferARB(@GLenum int target); @@ -124,5 +125,6 @@ public interface ARB_buffer_object { void glGetBufferParameterivARB(@GLenum int target, @GLenum int pname, @Check("4") IntBuffer params); @StripPostfix("pointer") + @AutoResultSize("GLChecks.getBufferObjectSizeARB(caps, target)") void glGetBufferPointervARB(@GLenum int target, @GLenum int pname, @Result @GLvoid ByteBuffer pointer); } diff --git a/src/templates/org/lwjgl/opengl/GL15.java b/src/templates/org/lwjgl/opengl/GL15.java index 7acdfb8c..e075e430 100644 --- a/src/templates/org/lwjgl/opengl/GL15.java +++ b/src/templates/org/lwjgl/opengl/GL15.java @@ -123,6 +123,7 @@ public interface GL15 { */ @CachedResult @GLvoid + @AutoResultSize("GLChecks.getBufferObjectSize(caps, target)") ByteBuffer glMapBuffer(@GLenum int target, @GLenum int access); boolean glUnmapBuffer(@GLenum int target); @@ -131,6 +132,7 @@ public interface GL15 { void glGetBufferParameteriv(@GLenum int target, @GLenum int pname, @Check("4") IntBuffer params); @StripPostfix("pointer") + @AutoResultSize("GLChecks.getBufferObjectSize(caps, target)") void glGetBufferPointerv(@GLenum int target, @GLenum int pname, @Result @GLvoid ByteBuffer pointer); // ----------------------------------------------------------------- diff --git a/src/templates/org/lwjgl/opengl/NV_vertex_array_range.java b/src/templates/org/lwjgl/opengl/NV_vertex_array_range.java index bbba60b7..85388ba0 100644 --- a/src/templates/org/lwjgl/opengl/NV_vertex_array_range.java +++ b/src/templates/org/lwjgl/opengl/NV_vertex_array_range.java @@ -54,7 +54,8 @@ public interface NV_vertex_array_range { @PlatformDependent({Platform.WGL, Platform.GLX}) @GLvoid - ByteBuffer glAllocateMemoryNV(@AutoResultSize int size, float readFrequency, float writeFrequency, float priority); + @AutoResultSize("size") + ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority); @PlatformDependent({Platform.WGL, Platform.GLX}) void glFreeMemoryNV(@Check @GLbyte Buffer pointer);