Added System.Drawing.Rectangle and RectangleF overloads to GL.Rect.

This commit is contained in:
the_fiddler 2008-06-24 18:23:32 +00:00
parent 74d9f5a0af
commit 5cb7606df9

View file

@ -641,7 +641,7 @@ namespace OpenTK.Graphics
#endregion #endregion
#region overloads using OpenTK.Math classes #region --- Overloads for OpenTK.Math ---
public static void Normal3(Vector3 normal) public static void Normal3(Vector3 normal)
{ {
@ -794,27 +794,27 @@ namespace OpenTK.Graphics
} }
} }
#endregion #endregion
#region public static void GetProgramInfoLog(Int32 program, out string info) #region public static void GetProgramInfoLog(Int32 program, out string info)
public static void GetProgramInfoLog(Int32 program, out string info) public static void GetProgramInfoLog(Int32 program, out string info)
{ {
unsafe unsafe
{ {
int length; int length;
GL.GetProgram(program, ProgramParameter.InfoLogLength, out length); GL.GetProgram(program, ProgramParameter.InfoLogLength, out length);
if (length == 0) if (length == 0)
{ {
info = ""; info = "";
return; return;
} }
StringBuilder sb = new StringBuilder(length); StringBuilder sb = new StringBuilder(length);
Delegates.glGetProgramInfoLog((UInt32)program, sb.Capacity, &length, sb); Delegates.glGetProgramInfoLog((UInt32)program, sb.Capacity, &length, sb);
info = sb.ToString(); info = sb.ToString();
} }
} }
#endregion #endregion
#region public static void PointParameter(PointSpriteCoordOriginParameter param) #region public static void PointParameter(PointSpriteCoordOriginParameter param)
@ -831,60 +831,98 @@ namespace OpenTK.Graphics
GL.PointParameter(PointParameterName.PointSpriteCoordOrigin, (int)param); GL.PointParameter(PointParameterName.PointSpriteCoordOrigin, (int)param);
} }
#endregion #endregion
#region public static void VertexAttrib2(Int32 index, ref Vector2 v) #region public static void VertexAttrib2(Int32 index, ref Vector2 v)
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); GL.VertexAttrib2(index, v.X, v.Y);
} }
#endregion #endregion
#region public static void VertexAttrib3(Int32 index, ref Vector3 v) #region public static void VertexAttrib3(Int32 index, ref Vector3 v)
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); GL.VertexAttrib3(index, v.X, v.Y, v.Z);
} }
#endregion #endregion
#region public static void VertexAttrib4(Int32 index, ref Vector4 v) #region public static void VertexAttrib4(Int32 index, ref Vector4 v)
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); GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
} }
#endregion #endregion
#region public static void MultiTexCoord2(TextureUnit target, ref Vector2 v) #region public static void MultiTexCoord2(TextureUnit target, ref Vector2 v)
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); GL.MultiTexCoord2(target, v.X, v.Y);
} }
#endregion #endregion
#region public static void MultiTexCoord3(TextureUnit target, ref Vector3 v) #region public static void MultiTexCoord3(TextureUnit target, ref Vector3 v)
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); GL.MultiTexCoord3(target, v.X, v.Y, v.Z);
} }
#endregion #endregion
#region public static void MultiTexCoord4(TextureUnit target, ref Vector4 v) #region public static void MultiTexCoord4(TextureUnit target, ref Vector4 v)
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); 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
#endregion #endregion