From 4abac1f814b8183078e313d4d25775c345963023 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 29 Mar 2009 15:26:58 +0000 Subject: [PATCH] Updated tokens for ARB_map_buffer_range (issue http://www.opentk.com/node/591). --- Source/Bind/Specifications/GL2/enumext.spec | 21 +++++++++++++------ Source/Bind/Specifications/GL2/gl.spec | 4 ++-- Source/OpenTK/Graphics/GL/GL.cs | 23 ++++----------------- Source/OpenTK/Graphics/GL/GLCore.cs | 4 ++-- Source/OpenTK/Graphics/GL/GLDelegates.cs | 4 ++-- Source/OpenTK/Graphics/GL/GLEnums.cs | 16 ++++++++------ 6 files changed, 35 insertions(+), 37 deletions(-) diff --git a/Source/Bind/Specifications/GL2/enumext.spec b/Source/Bind/Specifications/GL2/enumext.spec index ee5ea029..79be9e01 100644 --- a/Source/Bind/Specifications/GL2/enumext.spec +++ b/Source/Bind/Specifications/GL2/enumext.spec @@ -691,12 +691,12 @@ passthru: /* Reuse tokens from ARB_framebuffer_sRGB */ passthru: /* Reuse tokens from ARB_half_float_vertex */ # use ARB_half_float_vertex HALF_FLOAT passthru: /* Reuse tokens from ARB_map_buffer_range */ - use ARB_map_buffer_range MAP_READ_BIT - use ARB_map_buffer_range MAP_WRITE_BIT - use ARB_map_buffer_range MAP_INVALIDATE_RANGE_BIT - use ARB_map_buffer_range MAP_INVALIDATE_BUFFER_BIT - use ARB_map_buffer_range MAP_FLUSH_EXPLICIT_BIT - use ARB_map_buffer_range MAP_UNSYNCHRONIZED_BIT +# use ARB_map_buffer_range MAP_READ_BIT +# use ARB_map_buffer_range MAP_WRITE_BIT +# use ARB_map_buffer_range MAP_INVALIDATE_RANGE_BIT +# use ARB_map_buffer_range MAP_INVALIDATE_BUFFER_BIT +# use ARB_map_buffer_range MAP_FLUSH_EXPLICIT_BIT +# use ARB_map_buffer_range MAP_UNSYNCHRONIZED_BIT passthru: /* Reuse tokens from ARB_texture_compression_rgtc */ # use ARB_texture_compression_rgtc COMPRESSED_RED_RGTC1 # use ARB_texture_compression_rgtc COMPRESSED_SIGNED_RED_RGTC1 @@ -6464,6 +6464,15 @@ RenderbufferStorage enum: GetTextureParameter enum: TEXTURE_SHARED_SIZE = 0x8C3F +# Promoted from ARB_map_buffer_range +BufferAccessMask enum: + use ARB_map_buffer_range MAP_READ_BIT + use ARB_map_buffer_range MAP_WRITE_BIT + use ARB_map_buffer_range MAP_INVALIDATE_RANGE_BIT + use ARB_map_buffer_range MAP_INVALIDATE_BUFFER_BIT + use ARB_map_buffer_range MAP_FLUSH_EXPLICIT_BIT + use ARB_map_buffer_range MAP_UNSYNCHRONIZED_BIT + # Other OpenGL 3.0 changes: GetPName enum: MAJOR_VERSION = 0x821B diff --git a/Source/Bind/Specifications/GL2/gl.spec b/Source/Bind/Specifications/GL2/gl.spec index 3be78a78..069184ac 100644 --- a/Source/Bind/Specifications/GL2/gl.spec +++ b/Source/Bind/Specifications/GL2/gl.spec @@ -11117,7 +11117,7 @@ VertexAttribDivisor(index, divisor) MapBufferRange(target, offset, length, access) return VoidPointer - param target BufferTargetARB in value + param target BufferTarget in value # BufferTargetARB in value param offset BufferOffset in value param length BufferSize in value param access BufferAccessMask in value @@ -11132,7 +11132,7 @@ MapBufferRange(target, offset, length, access) # Promoted from APPLE_flush_buffer_range FlushMappedBufferRange(target, offset, length) return void - param target BufferTargetARB in value + param target BufferTarget in value # BufferTargetARB in value param offset BufferOffset in value param length BufferSize in value category ARB_map_buffer_range diff --git a/Source/OpenTK/Graphics/GL/GL.cs b/Source/OpenTK/Graphics/GL/GL.cs index f52f8f33..80390325 100644 --- a/Source/OpenTK/Graphics/GL/GL.cs +++ b/Source/OpenTK/Graphics/GL/GL.cs @@ -53804,28 +53804,13 @@ namespace OpenTK.Graphics [System.CLSCompliant(false)] [AutoGenerated(Category = "ArbMapBufferRange", Version = "3.0", EntryPoint = "glMapBufferRange")] public static - unsafe IntPtr MapBufferRange(OpenTK.Graphics.ArbMapBufferRange target, IntPtr offset, IntPtr length, UInt32 access) + unsafe IntPtr MapBufferRange(OpenTK.Graphics.BufferTarget target, IntPtr offset, IntPtr length, OpenTK.Graphics.BufferAccessMask access) { #if DEBUG using (new ErrorHelper(GraphicsContext.CurrentContext)) { #endif - return Delegates.glMapBufferRange((OpenTK.Graphics.ArbMapBufferRange)target, (IntPtr)offset, (IntPtr)length, (UInt32)access); - #if DEBUG - } - #endif - } - - [System.CLSCompliant(false)] - [AutoGenerated(Category = "ArbMapBufferRange", Version = "3.0", EntryPoint = "glMapBufferRange")] - public static - unsafe IntPtr MapBufferRange(OpenTK.Graphics.ArbMapBufferRange target, IntPtr offset, IntPtr length, Int32 access) - { - #if DEBUG - using (new ErrorHelper(GraphicsContext.CurrentContext)) - { - #endif - return Delegates.glMapBufferRange((OpenTK.Graphics.ArbMapBufferRange)target, (IntPtr)offset, (IntPtr)length, (UInt32)access); + return Delegates.glMapBufferRange((OpenTK.Graphics.BufferTarget)target, (IntPtr)offset, (IntPtr)length, (OpenTK.Graphics.BufferAccessMask)access); #if DEBUG } #endif @@ -53833,13 +53818,13 @@ namespace OpenTK.Graphics [AutoGenerated(Category = "ArbMapBufferRange", Version = "3.0", EntryPoint = "glFlushMappedBufferRange")] public static - void FlushMappedBufferRange(OpenTK.Graphics.ArbMapBufferRange target, IntPtr offset, IntPtr length) + void FlushMappedBufferRange(OpenTK.Graphics.BufferTarget target, IntPtr offset, IntPtr length) { #if DEBUG using (new ErrorHelper(GraphicsContext.CurrentContext)) { #endif - Delegates.glFlushMappedBufferRange((OpenTK.Graphics.ArbMapBufferRange)target, (IntPtr)offset, (IntPtr)length); + Delegates.glFlushMappedBufferRange((OpenTK.Graphics.BufferTarget)target, (IntPtr)offset, (IntPtr)length); #if DEBUG } #endif diff --git a/Source/OpenTK/Graphics/GL/GLCore.cs b/Source/OpenTK/Graphics/GL/GLCore.cs index cb7d5235..9d3aaa3e 100644 --- a/Source/OpenTK/Graphics/GL/GLCore.cs +++ b/Source/OpenTK/Graphics/GL/GLCore.cs @@ -2023,10 +2023,10 @@ namespace OpenTK.Graphics internal extern static void VertexAttribDivisor(UInt32 index, UInt32 divisor); [System.Security.SuppressUnmanagedCodeSecurity()] [System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glMapBufferRange", ExactSpelling = true)] - internal extern static unsafe IntPtr MapBufferRange(OpenTK.Graphics.ArbMapBufferRange target, IntPtr offset, IntPtr length, UInt32 access); + internal extern static unsafe IntPtr MapBufferRange(OpenTK.Graphics.BufferTarget target, IntPtr offset, IntPtr length, OpenTK.Graphics.BufferAccessMask access); [System.Security.SuppressUnmanagedCodeSecurity()] [System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glFlushMappedBufferRange", ExactSpelling = true)] - internal extern static void FlushMappedBufferRange(OpenTK.Graphics.ArbMapBufferRange target, IntPtr offset, IntPtr length); + internal extern static void FlushMappedBufferRange(OpenTK.Graphics.BufferTarget target, IntPtr offset, IntPtr length); [System.Security.SuppressUnmanagedCodeSecurity()] [System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glBindVertexArray", ExactSpelling = true)] internal extern static void BindVertexArray(UInt32 array); diff --git a/Source/OpenTK/Graphics/GL/GLDelegates.cs b/Source/OpenTK/Graphics/GL/GLDelegates.cs index 607c30cf..89157ee1 100644 --- a/Source/OpenTK/Graphics/GL/GLDelegates.cs +++ b/Source/OpenTK/Graphics/GL/GLDelegates.cs @@ -2654,10 +2654,10 @@ namespace OpenTK.Graphics internal delegate void VertexAttribDivisor(UInt32 index, UInt32 divisor); internal static VertexAttribDivisor glVertexAttribDivisor; [System.Security.SuppressUnmanagedCodeSecurity()] - internal unsafe delegate IntPtr MapBufferRange(OpenTK.Graphics.ArbMapBufferRange target, IntPtr offset, IntPtr length, UInt32 access); + internal unsafe delegate IntPtr MapBufferRange(OpenTK.Graphics.BufferTarget target, IntPtr offset, IntPtr length, OpenTK.Graphics.BufferAccessMask access); internal unsafe static MapBufferRange glMapBufferRange; [System.Security.SuppressUnmanagedCodeSecurity()] - internal delegate void FlushMappedBufferRange(OpenTK.Graphics.ArbMapBufferRange target, IntPtr offset, IntPtr length); + internal delegate void FlushMappedBufferRange(OpenTK.Graphics.BufferTarget target, IntPtr offset, IntPtr length); internal static FlushMappedBufferRange glFlushMappedBufferRange; [System.Security.SuppressUnmanagedCodeSecurity()] internal delegate void TexBufferARB(OpenTK.Graphics.TextureTarget target, OpenTK.Graphics.ArbTextureBufferObject internalformat, UInt32 buffer); diff --git a/Source/OpenTK/Graphics/GL/GLEnums.cs b/Source/OpenTK/Graphics/GL/GLEnums.cs index 5305b005..fb095d0e 100644 --- a/Source/OpenTK/Graphics/GL/GLEnums.cs +++ b/Source/OpenTK/Graphics/GL/GLEnums.cs @@ -6359,12 +6359,6 @@ namespace OpenTK.Graphics public enum Version30 { ContextFlagForwardCompatibleBit = ((int)0X0001), - MapReadBit = ((int)0X0001), - MapWriteBit = ((int)0X0002), - MapInvalidateRangeBit = ((int)0X0004), - MapInvalidateBufferBit = ((int)0X0008), - MapFlushExplicitBit = ((int)0X0010), - MapUnsynchronizedBit = ((int)0X0020), MaxClipDistances = ((int)0X0D32), ClipDistance0 = ((int)0X3000), ClipDistance1 = ((int)0X3001), @@ -9856,6 +9850,16 @@ namespace OpenTK.Graphics UnsignedNormalized = ((int)0X8c17), } + public enum BufferAccessMask + { + MapReadBit = ((int)0X0001), + MapWriteBit = ((int)0X0002), + MapInvalidateRangeBit = ((int)0X0004), + MapInvalidateBufferBit = ((int)0X0008), + MapFlushExplicitBit = ((int)0X0010), + MapUnsynchronizedBit = ((int)0X0020), + } + public enum IndexedStringName { Extensions = ((int)0X1f03),