From 006ce7a14fbfbe85d52881585d86048ec920feb9 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 4 Apr 2012 11:03:28 +0000 Subject: [PATCH] Added overloads for Gen* and Delete* functions with single objects as parameters. --- Source/OpenTK/Graphics/OpenGL/GLHelper.cs | 347 +++++++++++++++++++++- 1 file changed, 346 insertions(+), 1 deletion(-) diff --git a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs index 0dc550fa..8be21ce6 100644 --- a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs +++ b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs @@ -747,8 +747,237 @@ namespace OpenTK.Graphics.OpenGL #endregion + #region GenBuffers + + /// [requires: v1.5] + /// Generates a single buffer object name + /// + /// The generated buffer object name + public static int GenBuffers() + { + int id; + GenBuffers(1, out id); + return id; + } + + #endregion + + #region DeleteBuffers + + /// [requires: v1.5] + /// Deletes a single buffer object + /// + /// The buffer object to be deleted + public static void DeleteBuffers(int id) + { + DeleteBuffers(1, ref id); + } + + /// [requires: v1.5] + /// Deletes a single buffer object + /// + /// The buffer object to be deleted + [CLSCompliant(false)] + public static void DeleteBuffers(uint id) + { + DeleteBuffers(1, ref id); + } + + #endregion + + #region GenFramebuffers + + /// [requires: v3.0 and ARB_framebuffer_object] + /// Generates a single framebuffer object name + /// + /// The generated framebuffer object name + public static int GenFramebuffers() + { + int id; + GenFramebuffers(1, out id); + return id; + } + + #endregion + + #region DeleteFramebuffers + + /// [requires: v3.0 and ARB_framebuffer_object] + /// Deletes a single framebuffer object + /// + /// The framebuffer object to be deleted + public static void DeleteFramebuffers(int id) + { + DeleteFramebuffers(1, ref id); + } + + /// [requires: v3.0 and ARB_framebuffer_object] + /// Deletes a single framebuffer object + /// + /// The framebuffer object to be deleted + [CLSCompliant(false)] + public static void DeleteFramebuffers(uint id) + { + DeleteFramebuffers(1, ref id); + } + + #endregion + + #region GenProgramPipelines + + /// [requires: v4.1 and ARB_separate_shader_objects] + /// Generates a single single pipeline object name + /// + /// The generated single pipeline object name + public static int GenProgramPipelines() + { + int id; + GenProgramPipelines(1, out id); + return id; + } + + #endregion + + #region DeleteProgramPipelines + + /// [requires: v4.1 and ARB_separate_shader_objects] + /// Deletes a single program pipeline object + /// + /// The program pipeline object to be deleted + public static void DeleteProgramPipelines(int id) + { + DeleteProgramPipelines(1, ref id); + } + + /// [requires: v4.1 and ARB_separate_shader_objects] + /// Deletes a single program pipeline object + /// + /// The program pipeline object to be deleted + [CLSCompliant(false)] + public static void DeleteProgramPipelines(uint id) + { + DeleteProgramPipelines(1, ref id); + } + + #endregion + + #region GenQueries + + /// [requires: v1.5] + /// Generates a single query object name + /// + /// The generated query object name + public static int GenQueries() + { + int id; + GenQueries(1, out id); + return id; + } + + #endregion + + #region DeleteQueries + + /// [requires: v1.5] + /// Deletes a single query object + /// + /// The query object to be deleted + public static void DeleteQueries(int id) + { + DeleteQueries(1, ref id); + } + + /// + /// Deletes a single query object + /// + /// The query object to be deleted + [CLSCompliant(false)] + public static void DeleteQueries(uint id) + { + DeleteQueries(1, ref id); + } + + #endregion + + #region GenRenderbuffers + + /// [requires: v3.0 and ARB_framebuffer_object] + /// Generates a single renderbuffer object name + /// + /// The generated renderbuffer object name + public static int GenRenderbuffers() + { + int id; + GenRenderbuffers(1, out id); + return id; + } + + #endregion + + #region DeleteRenderbuffers + + /// [requires: v3.0 and ARB_framebuffer_object] + /// Deletes a single renderbuffer object + /// + /// The renderbuffer object to be deleted + public static void DeleteRenderbuffers(int id) + { + DeleteRenderbuffers(1, ref id); + } + + /// [requires: v3.0 and ARB_framebuffer_object] + /// Deletes a single renderbuffer object + /// + /// The renderbuffer object to be deleted + [CLSCompliant(false)] + public static void DeleteRenderbuffers(uint id) + { + DeleteRenderbuffers(1, ref id); + } + + #endregion + + #region GenSamplers + + /// + /// Generates a single sampler object name + /// + /// The generated sampler object name + public static int GenSamplers() + { + int id; + GenSamplers(1, out id); + return id; + } + + #endregion + + #region DeleteSamplers + + /// + /// Deletes a single sampler object + /// + /// The sampler object to be deleted + public static void DeleteSamplers(int id) + { + DeleteSamplers(1, ref id); + } + + /// + /// Deletes a single sampler object + /// + /// The sampler object to be deleted + [CLSCompliant(false)] + public static void DeleteSamplers(uint id) + { + DeleteSamplers(1, ref id); + } + + #endregion + #region public static int GenTexture() + [Obsolete("Use GenTextures instead.")] public static int GenTexture() { int id; @@ -760,11 +989,13 @@ namespace OpenTK.Graphics.OpenGL #region DeleteTexture + [Obsolete("Use DeleteTextures instead.")] public static void DeleteTexture(int id) { DeleteTextures(1, ref id); } - + + [Obsolete("Use DeleteTextures instead.")] [CLSCompliant(false)] public static void DeleteTexture(uint id) { @@ -773,6 +1004,120 @@ namespace OpenTK.Graphics.OpenGL #endregion + #region GenTextures + + /// [requires: v1.1] + /// Generate a single texture name + /// + /// The generated texture name + public static int GenTextures() + { + int id; + GenTextures(1, out id); + return id; + } + + #endregion + + #region DeleteTextures + + /// [requires: v1.1] + /// Delete a single texture name + /// + /// The texture to be deleted + public static void DeleteTextures(int id) + { + DeleteTextures(1, ref id); + } + + /// [requires: v1.1] + /// Delete a single texture name + /// + /// The texture to be deleted + [CLSCompliant(false)] + public static void DeleteTextures(uint id) + { + DeleteTextures(1, ref id); + } + + #endregion + + #region GenTransformFeedback + + /// [requires: v1.2 and ARB_transform_feedback2] + /// Generates a single transform feedback object name + /// + /// The generated transform feedback object name + public static int GenTransformFeedback() + { + int id; + GenTransformFeedback(1, out id); + return id; + } + + #endregion + + #region DeleteTransformFeedback + + /// [requires: v1.2 and ARB_transform_feedback2] + /// Deletes a single transform feedback object + /// + /// The transform feedback object to be deleted + public static void DeleteTransformFeedback(int id) + { + DeleteTransformFeedback(1, ref id); + } + + /// [requires: v1.2 and ARB_transform_feedback2] + /// Deletes a single transform feedback object + /// + /// The transform feedback object to be deleted + [CLSCompliant(false)] + public static void DeleteTransformFeedback(uint id) + { + DeleteTransformFeedback(1, ref id); + } + + #endregion + + #region GenVertexArrays + + /// [requires: v3.0 and ARB_vertex_array_object] + /// Generates a single vertex array object name + /// + /// The generated vertex array object name + public static int GenVertexArrays() + { + int id; + GenVertexArrays(1, out id); + return id; + } + + #endregion + + #region DeleteVertexArrays + + /// [requires: v3.0 and ARB_vertex_array_object] + /// Deletes a single vertex array object + /// + /// The vertex array object to be deleted + public static void DeleteVertexArrays(int id) + { + DeleteVertexArrays(1, ref id); + } + + /// [requires: v3.0 and ARB_vertex_array_object] + /// Deletes a single vertex array object + /// + /// The vertex array object to be deleted + [CLSCompliant(false)] + public static void DeleteVertexArrays(uint id) + { + DeleteVertexArrays(1, ref id); + } + + #endregion + #region [Vertex|Normal|Index|Color|FogCoord|VertexAttrib]Pointer public static void VertexPointer(int size, VertexPointerType type, int stride, int offset)