From 26645b1cee928d644756247b41aee652013365ce Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 24 Jun 2008 18:23:32 +0000 Subject: [PATCH] Added System.Drawing.Rectangle and RectangleF overloads to GL.Rect. --- Source/OpenTK/Graphics/GL/GLHelper.cs | 190 +++++++++++++++----------- 1 file changed, 114 insertions(+), 76 deletions(-) diff --git a/Source/OpenTK/Graphics/GL/GLHelper.cs b/Source/OpenTK/Graphics/GL/GLHelper.cs index c744c5d2..48dce12f 100644 --- a/Source/OpenTK/Graphics/GL/GLHelper.cs +++ b/Source/OpenTK/Graphics/GL/GLHelper.cs @@ -641,7 +641,7 @@ namespace OpenTK.Graphics #endregion - #region overloads using OpenTK.Math classes + #region --- Overloads for OpenTK.Math --- public static void Normal3(Vector3 normal) { @@ -794,27 +794,27 @@ namespace OpenTK.Graphics } } - #endregion - - #region public static void GetProgramInfoLog(Int32 program, out string info) - - public static void GetProgramInfoLog(Int32 program, out string info) - { - unsafe - { - int length; - GL.GetProgram(program, ProgramParameter.InfoLogLength, out length); - if (length == 0) - { - info = ""; - return; - } - StringBuilder sb = new StringBuilder(length); - Delegates.glGetProgramInfoLog((UInt32)program, sb.Capacity, &length, sb); - info = sb.ToString(); - } - } - + #endregion + + #region public static void GetProgramInfoLog(Int32 program, out string info) + + public static void GetProgramInfoLog(Int32 program, out string info) + { + unsafe + { + int length; + GL.GetProgram(program, ProgramParameter.InfoLogLength, out length); + if (length == 0) + { + info = ""; + return; + } + StringBuilder sb = new StringBuilder(length); + Delegates.glGetProgramInfoLog((UInt32)program, sb.Capacity, &length, sb); + info = sb.ToString(); + } + } + #endregion #region public static void PointParameter(PointSpriteCoordOriginParameter param) @@ -831,60 +831,98 @@ namespace OpenTK.Graphics GL.PointParameter(PointParameterName.PointSpriteCoordOrigin, (int)param); } - #endregion - - #region public static void VertexAttrib2(Int32 index, ref Vector2 v) - - public static void VertexAttrib2(Int32 index, ref Vector2 v) - { - GL.VertexAttrib2(index, v.X, v.Y); - } - - #endregion - - #region public static void VertexAttrib3(Int32 index, ref Vector3 v) - - public static void VertexAttrib3(Int32 index, ref Vector3 v) - { - GL.VertexAttrib3(index, v.X, v.Y, v.Z); - } - - #endregion - - #region public static void VertexAttrib4(Int32 index, ref Vector4 v) - - public static void VertexAttrib4(Int32 index, ref Vector4 v) - { - GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W); - } - - #endregion - - #region public static void MultiTexCoord2(TextureUnit target, ref Vector2 v) - - public static void MultiTexCoord2(TextureUnit target, ref Vector2 v) - { - GL.MultiTexCoord2(target, v.X, v.Y); - } - - #endregion - - #region public static void MultiTexCoord3(TextureUnit target, ref Vector3 v) - - public static void MultiTexCoord3(TextureUnit target, ref Vector3 v) - { - GL.MultiTexCoord3(target, v.X, v.Y, v.Z); - } - - #endregion - - #region public static void MultiTexCoord4(TextureUnit target, ref Vector4 v) - - public static void MultiTexCoord4(TextureUnit target, ref Vector4 v) - { - GL.MultiTexCoord4(target, v.X, v.Y, v.Z, v.W); - } - + #endregion + + #region public static void VertexAttrib2(Int32 index, ref Vector2 v) + + public static void VertexAttrib2(Int32 index, ref Vector2 v) + { + GL.VertexAttrib2(index, v.X, v.Y); + } + + #endregion + + #region public static void VertexAttrib3(Int32 index, ref Vector3 v) + + public static void VertexAttrib3(Int32 index, ref Vector3 v) + { + GL.VertexAttrib3(index, v.X, v.Y, v.Z); + } + + #endregion + + #region public static void VertexAttrib4(Int32 index, ref Vector4 v) + + public static void VertexAttrib4(Int32 index, ref Vector4 v) + { + GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W); + } + + #endregion + + #region public static void MultiTexCoord2(TextureUnit target, ref Vector2 v) + + public static void MultiTexCoord2(TextureUnit target, ref Vector2 v) + { + GL.MultiTexCoord2(target, v.X, v.Y); + } + + #endregion + + #region public static void MultiTexCoord3(TextureUnit target, ref Vector3 v) + + public static void MultiTexCoord3(TextureUnit target, ref Vector3 v) + { + GL.MultiTexCoord3(target, v.X, v.Y, v.Z); + } + + #endregion + + #region public static void MultiTexCoord4(TextureUnit target, ref Vector4 v) + + public static void MultiTexCoord4(TextureUnit target, ref Vector4 v) + { + GL.MultiTexCoord4(target, v.X, v.Y, v.Z, v.W); + } + + #endregion + + #region public static void Rect(System.Drawing.RectangleF rect) + + public static void Rect(System.Drawing.RectangleF rect) + { + GL.Rect(rect.Left, rect.Top, rect.Right, rect.Bottom); + } + + #endregion + + #region public static void Rect(ref System.Drawing.RectangleF rect) + + [CLSCompliant(false)] + public static void Rect(ref System.Drawing.RectangleF rect) + { + GL.Rect(rect.Left, rect.Top, rect.Right, rect.Bottom); + } + + #endregion + + #region public static void Rect(System.Drawing.Rectangle rect) + + public static void Rect(System.Drawing.Rectangle rect) + { + GL.Rect(rect.Left, rect.Top, rect.Right, rect.Bottom); + } + + #endregion + + #region public static void Rect(ref System.Drawing.Rectangle rect) + + [CLSCompliant(false)] + public static void Rect(ref System.Drawing.Rectangle rect) + { + GL.Rect(rect.Left, rect.Top, rect.Right, rect.Bottom); + } + #endregion #endregion