From 2d1df46d98b3325c483b5ce0bf34d73342f18472 Mon Sep 17 00:00:00 2001 From: Stefanos A Date: Thu, 7 Nov 2013 10:17:33 +0100 Subject: [PATCH] ES 3.0 strong enums for DrawArrays*() and Draw*Elements*() The strongly-typed enums include core and extension varieties. --- Source/Bind/Specifications/GL2/overrides.xml | 20 ++++++++++ Source/OpenTK/Graphics/ES30/ES30.cs | 40 ++++++++++---------- Source/OpenTK/Graphics/ES30/ES30Core.cs | 4 +- Source/OpenTK/Graphics/ES30/ES30Delegates.cs | 4 +- Source/OpenTK/Graphics/ES30/ES30Enums.cs | 4 +- 5 files changed, 46 insertions(+), 26 deletions(-) diff --git a/Source/Bind/Specifications/GL2/overrides.xml b/Source/Bind/Specifications/GL2/overrides.xml index e6422fc3..3bfccfba 100644 --- a/Source/Bind/Specifications/GL2/overrides.xml +++ b/Source/Bind/Specifications/GL2/overrides.xml @@ -5105,6 +5105,26 @@ VertexAttribIntegerType + + + PrimitiveType + + + PrimitiveType + + + PrimitiveType + DrawElementsType + + + PrimitiveType + DrawElementsType + + + PrimitiveType + DrawElementsType + + ProgramParameterName diff --git a/Source/OpenTK/Graphics/ES30/ES30.cs b/Source/OpenTK/Graphics/ES30/ES30.cs index 814b3e03..fe68fb5c 100644 --- a/Source/OpenTK/Graphics/ES30/ES30.cs +++ b/Source/OpenTK/Graphics/ES30/ES30.cs @@ -1348,13 +1348,13 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "ANGLE_instanced_arrays", Version = "", EntryPoint = "glDrawElementsInstancedANGLE")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, IntPtr indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 primcount) { #if DEBUG using (new ErrorHelper(GraphicsContext.CurrentContext)) { #endif - Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices, (Int32)primcount); + Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices, (Int32)primcount); #if DEBUG } #endif @@ -1391,7 +1391,7 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "ANGLE_instanced_arrays", Version = "", EntryPoint = "glDrawElementsInstancedANGLE")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, [InAttribute, OutAttribute] T3[] indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, [InAttribute, OutAttribute] T3[] indices, Int32 primcount) where T3 : struct { #if DEBUG @@ -1401,7 +1401,7 @@ namespace OpenTK.Graphics.ES30 GCHandle indices_ptr = GCHandle.Alloc(indices, GCHandleType.Pinned); try { - Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); + Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); } finally { @@ -1443,7 +1443,7 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "ANGLE_instanced_arrays", Version = "", EntryPoint = "glDrawElementsInstancedANGLE")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, [InAttribute, OutAttribute] T3[,] indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, [InAttribute, OutAttribute] T3[,] indices, Int32 primcount) where T3 : struct { #if DEBUG @@ -1453,7 +1453,7 @@ namespace OpenTK.Graphics.ES30 GCHandle indices_ptr = GCHandle.Alloc(indices, GCHandleType.Pinned); try { - Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); + Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); } finally { @@ -1495,7 +1495,7 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "ANGLE_instanced_arrays", Version = "", EntryPoint = "glDrawElementsInstancedANGLE")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, [InAttribute, OutAttribute] T3[,,] indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, [InAttribute, OutAttribute] T3[,,] indices, Int32 primcount) where T3 : struct { #if DEBUG @@ -1505,7 +1505,7 @@ namespace OpenTK.Graphics.ES30 GCHandle indices_ptr = GCHandle.Alloc(indices, GCHandleType.Pinned); try { - Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); + Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); } finally { @@ -1547,7 +1547,7 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "ANGLE_instanced_arrays", Version = "", EntryPoint = "glDrawElementsInstancedANGLE")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, [InAttribute, OutAttribute] ref T3 indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, [InAttribute, OutAttribute] ref T3 indices, Int32 primcount) where T3 : struct { #if DEBUG @@ -1557,7 +1557,7 @@ namespace OpenTK.Graphics.ES30 GCHandle indices_ptr = GCHandle.Alloc(indices, GCHandleType.Pinned); try { - Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); + Delegates.glDrawElementsInstancedANGLE((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); indices = (T3)indices_ptr.Target; } finally @@ -48378,13 +48378,13 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "NV_draw_instanced", Version = "", EntryPoint = "glDrawElementsInstancedNV")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, IntPtr indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 primcount) { #if DEBUG using (new ErrorHelper(GraphicsContext.CurrentContext)) { #endif - Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices, (Int32)primcount); + Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices, (Int32)primcount); #if DEBUG } #endif @@ -48421,7 +48421,7 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "NV_draw_instanced", Version = "", EntryPoint = "glDrawElementsInstancedNV")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, [InAttribute, OutAttribute] T3[] indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, [InAttribute, OutAttribute] T3[] indices, Int32 primcount) where T3 : struct { #if DEBUG @@ -48431,7 +48431,7 @@ namespace OpenTK.Graphics.ES30 GCHandle indices_ptr = GCHandle.Alloc(indices, GCHandleType.Pinned); try { - Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); + Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); } finally { @@ -48473,7 +48473,7 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "NV_draw_instanced", Version = "", EntryPoint = "glDrawElementsInstancedNV")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, [InAttribute, OutAttribute] T3[,] indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, [InAttribute, OutAttribute] T3[,] indices, Int32 primcount) where T3 : struct { #if DEBUG @@ -48483,7 +48483,7 @@ namespace OpenTK.Graphics.ES30 GCHandle indices_ptr = GCHandle.Alloc(indices, GCHandleType.Pinned); try { - Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); + Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); } finally { @@ -48525,7 +48525,7 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "NV_draw_instanced", Version = "", EntryPoint = "glDrawElementsInstancedNV")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, [InAttribute, OutAttribute] T3[,,] indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, [InAttribute, OutAttribute] T3[,,] indices, Int32 primcount) where T3 : struct { #if DEBUG @@ -48535,7 +48535,7 @@ namespace OpenTK.Graphics.ES30 GCHandle indices_ptr = GCHandle.Alloc(indices, GCHandleType.Pinned); try { - Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); + Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); } finally { @@ -48577,7 +48577,7 @@ namespace OpenTK.Graphics.ES30 /// [AutoGenerated(Category = "NV_draw_instanced", Version = "", EntryPoint = "glDrawElementsInstancedNV")] public static - void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, [InAttribute, OutAttribute] ref T3 indices, Int32 primcount) + void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, [InAttribute, OutAttribute] ref T3 indices, Int32 primcount) where T3 : struct { #if DEBUG @@ -48587,7 +48587,7 @@ namespace OpenTK.Graphics.ES30 GCHandle indices_ptr = GCHandle.Alloc(indices, GCHandleType.Pinned); try { - Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.All)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); + Delegates.glDrawElementsInstancedNV((OpenTK.Graphics.ES30.PrimitiveType)mode, (Int32)count, (OpenTK.Graphics.ES30.DrawElementsType)type, (IntPtr)indices_ptr.AddrOfPinnedObject(), (Int32)primcount); indices = (T3)indices_ptr.Target; } finally diff --git a/Source/OpenTK/Graphics/ES30/ES30Core.cs b/Source/OpenTK/Graphics/ES30/ES30Core.cs index a5061e49..6df31327 100644 --- a/Source/OpenTK/Graphics/ES30/ES30Core.cs +++ b/Source/OpenTK/Graphics/ES30/ES30Core.cs @@ -368,13 +368,13 @@ namespace OpenTK.Graphics.ES30 internal extern static void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 instancecount); [System.Security.SuppressUnmanagedCodeSecurity()] [System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawElementsInstancedANGLE", ExactSpelling = true)] - internal extern static void DrawElementsInstancedANGLE(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, IntPtr indices, Int32 primcount); + internal extern static void DrawElementsInstancedANGLE(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 primcount); [System.Security.SuppressUnmanagedCodeSecurity()] [System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawElementsInstancedEXT", ExactSpelling = true)] internal extern static void DrawElementsInstancedEXT(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 primcount); [System.Security.SuppressUnmanagedCodeSecurity()] [System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawElementsInstancedNV", ExactSpelling = true)] - internal extern static void DrawElementsInstancedNV(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, IntPtr indices, Int32 primcount); + internal extern static void DrawElementsInstancedNV(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 primcount); [System.Security.SuppressUnmanagedCodeSecurity()] [System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glDrawRangeElements", ExactSpelling = true)] internal extern static void DrawRangeElements(OpenTK.Graphics.ES30.PrimitiveType mode, UInt32 start, UInt32 end, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices); diff --git a/Source/OpenTK/Graphics/ES30/ES30Delegates.cs b/Source/OpenTK/Graphics/ES30/ES30Delegates.cs index a42ff166..a9f622f7 100644 --- a/Source/OpenTK/Graphics/ES30/ES30Delegates.cs +++ b/Source/OpenTK/Graphics/ES30/ES30Delegates.cs @@ -366,13 +366,13 @@ namespace OpenTK.Graphics.ES30 internal delegate void DrawElementsInstanced(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 instancecount); internal static DrawElementsInstanced glDrawElementsInstanced; [System.Security.SuppressUnmanagedCodeSecurity()] - internal delegate void DrawElementsInstancedANGLE(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, IntPtr indices, Int32 primcount); + internal delegate void DrawElementsInstancedANGLE(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 primcount); internal static DrawElementsInstancedANGLE glDrawElementsInstancedANGLE; [System.Security.SuppressUnmanagedCodeSecurity()] internal delegate void DrawElementsInstancedEXT(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 primcount); internal static DrawElementsInstancedEXT glDrawElementsInstancedEXT; [System.Security.SuppressUnmanagedCodeSecurity()] - internal delegate void DrawElementsInstancedNV(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.All type, IntPtr indices, Int32 primcount); + internal delegate void DrawElementsInstancedNV(OpenTK.Graphics.ES30.PrimitiveType mode, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices, Int32 primcount); internal static DrawElementsInstancedNV glDrawElementsInstancedNV; [System.Security.SuppressUnmanagedCodeSecurity()] internal delegate void DrawRangeElements(OpenTK.Graphics.ES30.PrimitiveType mode, UInt32 start, UInt32 end, Int32 count, OpenTK.Graphics.ES30.DrawElementsType type, IntPtr indices); diff --git a/Source/OpenTK/Graphics/ES30/ES30Enums.cs b/Source/OpenTK/Graphics/ES30/ES30Enums.cs index 79129feb..e18cd57f 100644 --- a/Source/OpenTK/Graphics/ES30/ES30Enums.cs +++ b/Source/OpenTK/Graphics/ES30/ES30Enums.cs @@ -385,7 +385,7 @@ namespace OpenTK.Graphics.ES30 } /// - /// Used in GL.Amd.GetPerfMonitorCounterData, GL.Amd.GetPerfMonitorCounterInfo and 49 other functions + /// Used in GL.Amd.GetPerfMonitorCounterData, GL.Amd.GetPerfMonitorCounterInfo and 47 other functions /// public enum All : int { @@ -10586,7 +10586,7 @@ namespace OpenTK.Graphics.ES30 } /// - /// Used in GL.DrawElements, GL.DrawElementsInstanced and 3 other functions + /// Used in GL.Angle.DrawElementsInstanced, GL.DrawElements and 5 other functions /// public enum DrawElementsType : int {