00001 #region --- License ---
00002
00003
00004
00005
00006
00007 #endregion
00008
00009 #region --- Using Directives ---
00010
00011 using System;
00012 using System.Collections.Generic;
00013 using System.Text;
00014 using System.Runtime.InteropServices;
00015 using System.Reflection;
00016 using System.Diagnostics;
00017 using System.Reflection.Emit;
00018
00019
00020 #endregion
00021
00022 namespace OpenTK.Graphics.OpenGL
00023 {
00049 public sealed partial class GL : GraphicsBindingsBase
00050 {
00051 #region --- Fields ---
00052
00053 internal const string Library = "opengl32.dll";
00054
00055 static SortedList<string, bool> AvailableExtensions = new SortedList<string, bool>();
00056 static readonly object sync_root = new object();
00057
00058 #endregion
00059
00060 #region --- Constructor ---
00061
00062 static GL()
00063 {
00064 }
00065
00066 #endregion
00067
00068 #region --- Public Members ---
00069
00074 [Obsolete("If you are using a context constructed outside of OpenTK, create a new GraphicsContext and pass your context handle to it. Otherwise, there is no need to call this method.")]
00075 public static void LoadAll()
00076 {
00077 new GL().LoadEntryPoints();
00078 }
00079
00080 #endregion
00081
00082 #region --- Protected Members ---
00083
00087 protected override object SyncRoot
00088 {
00089 get { return sync_root; }
00090 }
00091
00092 #endregion
00093
00094 #region --- GL Overloads ---
00095
00096 #pragma warning disable 3019
00097 #pragma warning disable 1591
00098 #pragma warning disable 1572
00099 #pragma warning disable 1573
00100
00101
00102
00103
00104 #region public static void Color[34]() overloads
00105
00106 public static void Color3(System.Drawing.Color color)
00107 {
00108 GL.Color3(color.R, color.G, color.B);
00109 }
00110
00111 public static void Color4(System.Drawing.Color color)
00112 {
00113 GL.Color4(color.R, color.G, color.B, color.A);
00114 }
00115
00116 public static void Color3(Vector3 color)
00117 {
00118 GL.Color3(color.X, color.Y, color.Z);
00119 }
00120
00121 public static void Color4(Vector4 color)
00122 {
00123 GL.Color4(color.X, color.Y, color.Z, color.W);
00124 }
00125
00126 public static void Color4(Color4 color)
00127 {
00128 GL.Color4(color.R, color.G, color.B, color.A);
00129 }
00130
00131 #endregion
00132
00133 #region public static void ClearColor() overloads
00134
00135 public static void ClearColor(System.Drawing.Color color)
00136 {
00137 GL.ClearColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
00138 }
00139
00140 public static void ClearColor(Color4 color)
00141 {
00142 GL.ClearColor(color.R, color.G, color.B, color.A);
00143 }
00144
00145 #endregion
00146
00147 #region public static void BlendColor() overloads
00148
00149 public static void BlendColor(System.Drawing.Color color)
00150 {
00151 GL.BlendColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
00152 }
00153
00154 public static void BlendColor(Color4 color)
00155 {
00156 GL.BlendColor(color.R, color.G, color.B, color.A);
00157 }
00158
00159 #endregion
00160
00161 #region public static void Material() overloads
00162
00163 public static void Material(MaterialFace face, MaterialParameter pname, Vector4 @params)
00164 {
00165 unsafe { Material(face, pname, (float*)&@params.X); }
00166 }
00167
00168 public static void Material(MaterialFace face, MaterialParameter pname, Color4 @params)
00169 {
00170 unsafe { GL.Material(face, pname, (float*)&@params); }
00171 }
00172
00173 #endregion
00174
00175 #region public static void Light() overloads
00176
00177 public static void Light(LightName name, LightParameter pname, Vector4 @params)
00178 {
00179 unsafe { GL.Light(name, pname, (float*)&@params.X); }
00180 }
00181
00182 public static void Light(LightName name, LightParameter pname, Color4 @params)
00183 {
00184 unsafe { GL.Light(name, pname, (float*)&@params); }
00185 }
00186
00187 #endregion
00188
00189 #region Normal|RasterPos|Vertex|TexCoord|Rotate|Scale|Translate|*Matrix
00190
00191 public static void Normal3(Vector3 normal)
00192 {
00193 GL.Normal3(normal.X, normal.Y, normal.Z);
00194 }
00195
00196 public static void RasterPos2(Vector2 pos)
00197 {
00198 GL.RasterPos2(pos.X, pos.Y);
00199 }
00200
00201 public static void RasterPos3(Vector3 pos)
00202 {
00203 GL.RasterPos3(pos.X, pos.Y, pos.Z);
00204 }
00205
00206 public static void RasterPos4(Vector4 pos)
00207 {
00208 GL.RasterPos4(pos.X, pos.Y, pos.Z, pos.W);
00209 }
00210
00211 public static void Vertex2(Vector2 v)
00212 {
00213 GL.Vertex2(v.X, v.Y);
00214 }
00215
00216 public static void Vertex3(Vector3 v)
00217 {
00218 GL.Vertex3(v.X, v.Y, v.Z);
00219 }
00220
00221 public static void Vertex4(Vector4 v)
00222 {
00223 GL.Vertex4(v.X, v.Y, v.Z, v.W);
00224 }
00225
00226 public static void TexCoord2(Vector2 v)
00227 {
00228 GL.TexCoord2(v.X, v.Y);
00229 }
00230
00231 public static void TexCoord3(Vector3 v)
00232 {
00233 GL.TexCoord3(v.X, v.Y, v.Z);
00234 }
00235
00236 public static void TexCoord4(Vector4 v)
00237 {
00238 GL.TexCoord4(v.X, v.Y, v.Z, v.W);
00239 }
00240
00241 public static void Rotate(Single angle, Vector3 axis)
00242 {
00243 GL.Rotate((Single)angle, axis.X, axis.Y, axis.Z);
00244 }
00245
00246 public static void Scale(Vector3 scale)
00247 {
00248 GL.Scale(scale.X, scale.Y, scale.Z);
00249 }
00250
00251 public static void Translate(Vector3 trans)
00252 {
00253 GL.Translate(trans.X, trans.Y, trans.Z);
00254 }
00255
00256 public static void MultMatrix(ref Matrix4 mat)
00257 {
00258 unsafe
00259 {
00260 fixed (Single* m_ptr = &mat.Row0.X)
00261 {
00262 GL.MultMatrix((Single*)m_ptr);
00263 }
00264 }
00265 }
00266
00267 public static void LoadMatrix(ref Matrix4 mat)
00268 {
00269 unsafe
00270 {
00271 fixed (Single* m_ptr = &mat.Row0.X)
00272 {
00273 GL.LoadMatrix((Single*)m_ptr);
00274 }
00275 }
00276 }
00277
00278 public static void LoadTransposeMatrix(ref Matrix4 mat)
00279 {
00280 unsafe
00281 {
00282 fixed (Single* m_ptr = &mat.Row0.X)
00283 {
00284 GL.LoadTransposeMatrix((Single*)m_ptr);
00285 }
00286 }
00287 }
00288
00289 public static void MultTransposeMatrix(ref Matrix4 mat)
00290 {
00291 unsafe
00292 {
00293 fixed (Single* m_ptr = &mat.Row0.X)
00294 {
00295 GL.MultTransposeMatrix((Single*)m_ptr);
00296 }
00297 }
00298 }
00299
00300 public static void UniformMatrix4(int location, bool transpose, ref Matrix4 matrix)
00301 {
00302 unsafe
00303 {
00304 fixed (float* matrix_ptr = &matrix.Row0.X)
00305 {
00306 GL.UniformMatrix4(location, 1, transpose, matrix_ptr);
00307 }
00308 }
00309 }
00310
00311 public static void Normal3(Vector3d normal)
00312 {
00313 GL.Normal3(normal.X, normal.Y, normal.Z);
00314 }
00315
00316 public static void RasterPos2(Vector2d pos)
00317 {
00318 GL.RasterPos2(pos.X, pos.Y);
00319 }
00320
00321 public static void RasterPos3(Vector3d pos)
00322 {
00323 GL.RasterPos3(pos.X, pos.Y, pos.Z);
00324 }
00325
00326 public static void RasterPos4(Vector4d pos)
00327 {
00328 GL.RasterPos4(pos.X, pos.Y, pos.Z, pos.W);
00329 }
00330
00331 public static void Vertex2(Vector2d v)
00332 {
00333 GL.Vertex2(v.X, v.Y);
00334 }
00335
00336 public static void Vertex3(Vector3d v)
00337 {
00338 GL.Vertex3(v.X, v.Y, v.Z);
00339 }
00340
00341 public static void Vertex4(Vector4d v)
00342 {
00343 GL.Vertex4(v.X, v.Y, v.Z, v.W);
00344 }
00345
00346 public static void TexCoord2(Vector2d v)
00347 {
00348 GL.TexCoord2(v.X, v.Y);
00349 }
00350
00351 public static void TexCoord3(Vector3d v)
00352 {
00353 GL.TexCoord3(v.X, v.Y, v.Z);
00354 }
00355
00356 public static void TexCoord4(Vector4d v)
00357 {
00358 GL.TexCoord4(v.X, v.Y, v.Z, v.W);
00359 }
00360
00361 public static void Rotate(double angle, Vector3d axis)
00362 {
00363 GL.Rotate((double)angle, axis.X, axis.Y, axis.Z);
00364 }
00365
00366 public static void Scale(Vector3d scale)
00367 {
00368 GL.Scale(scale.X, scale.Y, scale.Z);
00369 }
00370
00371 public static void Translate(Vector3d trans)
00372 {
00373 GL.Translate(trans.X, trans.Y, trans.Z);
00374 }
00375
00376 public static void MultMatrix(ref Matrix4d mat)
00377 {
00378 unsafe
00379 {
00380 fixed (Double* m_ptr = &mat.Row0.X)
00381 {
00382 GL.MultMatrix((Double*)m_ptr);
00383 }
00384 }
00385 }
00386
00387 public static void LoadMatrix(ref Matrix4d mat)
00388 {
00389 unsafe
00390 {
00391 fixed (Double* m_ptr = &mat.Row0.X)
00392 {
00393 GL.LoadMatrix((Double*)m_ptr);
00394 }
00395 }
00396 }
00397
00398 public static void LoadTransposeMatrix(ref Matrix4d mat)
00399 {
00400 unsafe
00401 {
00402 fixed (Double* m_ptr = &mat.Row0.X)
00403 {
00404 GL.LoadTransposeMatrix((Double*)m_ptr);
00405 }
00406 }
00407 }
00408
00409 public static void MultTransposeMatrix(ref Matrix4d mat)
00410 {
00411 unsafe
00412 {
00413 fixed (Double* m_ptr = &mat.Row0.X)
00414 {
00415 GL.MultTransposeMatrix((Double*)m_ptr);
00416 }
00417 }
00418 }
00419
00420 #region Uniform
00421
00422 [CLSCompliant(false)]
00423 public static void Uniform2(int location, ref Vector2 vector)
00424 {
00425 GL.Uniform2(location, vector.X, vector.Y);
00426 }
00427
00428 [CLSCompliant(false)]
00429 public static void Uniform3(int location, ref Vector3 vector)
00430 {
00431 GL.Uniform3(location, vector.X, vector.Y, vector.Z);
00432 }
00433
00434 [CLSCompliant(false)]
00435 public static void Uniform4(int location, ref Vector4 vector)
00436 {
00437 GL.Uniform4(location, vector.X, vector.Y, vector.Z, vector.W);
00438 }
00439
00440 public static void Uniform2(int location, Vector2 vector)
00441 {
00442 GL.Uniform2(location, vector.X, vector.Y);
00443 }
00444
00445 public static void Uniform3(int location, Vector3 vector)
00446 {
00447 GL.Uniform3(location, vector.X, vector.Y, vector.Z);
00448 }
00449
00450 public static void Uniform4(int location, Vector4 vector)
00451 {
00452 GL.Uniform4(location, vector.X, vector.Y, vector.Z, vector.W);
00453 }
00454
00455 public static void Uniform4(int location, Color4 color)
00456 {
00457 GL.Uniform4(location, color.R, color.G, color.B, color.A);
00458 }
00459
00460 public static void Uniform4(int location, Quaternion quaternion)
00461 {
00462 GL.Uniform4(location, quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
00463 }
00464
00465 #endregion
00466
00467 #endregion
00468
00469 #region Shaders
00470
00471 #region GetActiveAttrib
00472
00473 public static string GetActiveAttrib(int program, int index, out int size, out ActiveAttribType type)
00474 {
00475 int length;
00476 GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.ActiveAttributeMaxLength, out length);
00477 StringBuilder sb = new StringBuilder(length == 0 ? 1 : length * 2);
00478
00479 GetActiveAttrib(program, index, sb.Capacity, out length, out size, out type, sb);
00480 return sb.ToString();
00481 }
00482
00483 #endregion
00484
00485 #region GetActiveUniform
00486
00487 public static string GetActiveUniform(int program, int uniformIndex, out int size, out ActiveUniformType type)
00488 {
00489 int length;
00490 GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.ActiveUniformMaxLength, out length);
00491
00492 StringBuilder sb = new StringBuilder(length == 0 ? 1 : length);
00493 GetActiveUniform(program, uniformIndex, sb.Capacity, out length, out size, out type, sb);
00494 return sb.ToString();
00495 }
00496
00497 #endregion
00498
00499 #region GetActiveUniformName
00500
00501 public static string GetActiveUniformName(int program, int uniformIndex)
00502 {
00503 int length;
00504 GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.ActiveUniformMaxLength, out length);
00505 StringBuilder sb = new StringBuilder(length == 0 ? 1 : length * 2);
00506
00507 GetActiveUniformName(program, uniformIndex, sb.Capacity, out length, sb);
00508 return sb.ToString();
00509 }
00510
00511 #endregion
00512
00513 #region GetActiveUniformBlockName
00514
00515 public static string GetActiveUniformBlockName(int program, int uniformIndex)
00516 {
00517 int length;
00518 GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.ActiveUniformBlockMaxNameLength, out length);
00519 StringBuilder sb = new StringBuilder(length == 0 ? 1 : length * 2);
00520
00521 GetActiveUniformBlockName(program, uniformIndex, sb.Capacity, out length, sb);
00522 return sb.ToString();
00523 }
00524
00525 #endregion
00526
00527 #region public static void ShaderSource(Int32 shader, System.String @string)
00528
00529 public static void ShaderSource(Int32 shader, System.String @string)
00530 {
00531 unsafe
00532 {
00533 int length = @string.Length;
00534 GL.ShaderSource((UInt32)shader, 1, new string[] { @string }, &length);
00535 }
00536 }
00537
00538 #endregion
00539
00540 #region public static string GetShaderInfoLog(Int32 shader)
00541
00542 public static string GetShaderInfoLog(Int32 shader)
00543 {
00544 string info;
00545 GetShaderInfoLog(shader, out info);
00546 return info;
00547 }
00548
00549 #endregion
00550
00551 #region public static void GetShaderInfoLog(Int32 shader, out string info)
00552
00553 public static void GetShaderInfoLog(Int32 shader, out string info)
00554 {
00555 unsafe
00556 {
00557 int length;
00558 GL.GetShader(shader, ShaderParameter.InfoLogLength, out length);
00559 if (length == 0)
00560 {
00561 info = String.Empty;
00562 return;
00563 }
00564 StringBuilder sb = new StringBuilder(length * 2);
00565 GL.GetShaderInfoLog((UInt32)shader, sb.Capacity, &length, sb);
00566 info = sb.ToString();
00567 }
00568 }
00569
00570 #endregion
00571
00572 #region public static string GetProgramInfoLog(Int32 program)
00573
00574 public static string GetProgramInfoLog(Int32 program)
00575 {
00576 string info;
00577 GetProgramInfoLog(program, out info);
00578 return info;
00579 }
00580
00581 #endregion
00582
00583 #region public static void GetProgramInfoLog(Int32 program, out string info)
00584
00585 public static void GetProgramInfoLog(Int32 program, out string info)
00586 {
00587 unsafe
00588 {
00589 int length;
00590 GL.GetProgram(program, OpenTK.Graphics.OpenGL.ProgramParameter.InfoLogLength, out length); if (length == 0)
00591 {
00592 info = String.Empty;
00593 return;
00594 }
00595 StringBuilder sb = new StringBuilder(length * 2);
00596 GL.GetProgramInfoLog((UInt32)program, sb.Capacity, &length, sb);
00597 info = sb.ToString();
00598 }
00599 }
00600
00601 #endregion
00602
00603 #endregion
00604
00605 #region public static void PointParameter(PointSpriteCoordOriginParameter param)
00606
00614 public static void PointParameter(PointSpriteCoordOriginParameter param)
00615 {
00616 GL.PointParameter(PointParameterName.PointSpriteCoordOrigin, (int)param);
00617 }
00618
00619 #endregion
00620
00621 #region VertexAttrib|MultiTexCoord
00622
00623 [CLSCompliant(false)]
00624 public static void VertexAttrib2(Int32 index, ref Vector2 v)
00625 {
00626 GL.VertexAttrib2(index, v.X, v.Y);
00627 }
00628
00629 [CLSCompliant(false)]
00630 public static void VertexAttrib3(Int32 index, ref Vector3 v)
00631 {
00632 GL.VertexAttrib3(index, v.X, v.Y, v.Z);
00633 }
00634
00635 [CLSCompliant(false)]
00636 public static void VertexAttrib4(Int32 index, ref Vector4 v)
00637 {
00638 GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
00639 }
00640
00641 public static void VertexAttrib2(Int32 index, Vector2 v)
00642 {
00643 GL.VertexAttrib2(index, v.X, v.Y);
00644 }
00645
00646 public static void VertexAttrib3(Int32 index, Vector3 v)
00647 {
00648 GL.VertexAttrib3(index, v.X, v.Y, v.Z);
00649 }
00650
00651 public static void VertexAttrib4(Int32 index, Vector4 v)
00652 {
00653 GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
00654 }
00655
00656 public static void MultiTexCoord2(TextureUnit target, ref Vector2 v)
00657 {
00658 GL.MultiTexCoord2(target, v.X, v.Y);
00659 }
00660
00661 public static void MultiTexCoord3(TextureUnit target, ref Vector3 v)
00662 {
00663 GL.MultiTexCoord3(target, v.X, v.Y, v.Z);
00664 }
00665
00666 public static void MultiTexCoord4(TextureUnit target, ref Vector4 v)
00667 {
00668 GL.MultiTexCoord4(target, v.X, v.Y, v.Z, v.W);
00669 }
00670
00671 [CLSCompliant(false)]
00672 public static void VertexAttrib2(Int32 index, ref Vector2d v)
00673 {
00674 GL.VertexAttrib2(index, v.X, v.Y);
00675 }
00676
00677 [CLSCompliant(false)]
00678 public static void VertexAttrib3(Int32 index, ref Vector3d v)
00679 {
00680 GL.VertexAttrib3(index, v.X, v.Y, v.Z);
00681 }
00682
00683 [CLSCompliant(false)]
00684 public static void VertexAttrib4(Int32 index, ref Vector4d v)
00685 {
00686 GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
00687 }
00688
00689 public static void VertexAttrib2(Int32 index, Vector2d v)
00690 {
00691 GL.VertexAttrib2(index, v.X, v.Y);
00692 }
00693
00694 public static void VertexAttrib3(Int32 index, Vector3d v)
00695 {
00696 GL.VertexAttrib3(index, v.X, v.Y, v.Z);
00697 }
00698
00699 public static void VertexAttrib4(Int32 index, Vector4d v)
00700 {
00701 GL.VertexAttrib4(index, v.X, v.Y, v.Z, v.W);
00702 }
00703
00704 public static void MultiTexCoord2(TextureUnit target, ref Vector2d v)
00705 {
00706 GL.MultiTexCoord2(target, v.X, v.Y);
00707 }
00708
00709 public static void MultiTexCoord3(TextureUnit target, ref Vector3d v)
00710 {
00711 GL.MultiTexCoord3(target, v.X, v.Y, v.Z);
00712 }
00713
00714 public static void MultiTexCoord4(TextureUnit target, ref Vector4d v)
00715 {
00716 GL.MultiTexCoord4(target, v.X, v.Y, v.Z, v.W);
00717 }
00718
00719 #endregion
00720
00721 #region Rect
00722
00723 public static void Rect(System.Drawing.RectangleF rect)
00724 {
00725 GL.Rect(rect.Left, rect.Top, rect.Right, rect.Bottom);
00726 }
00727
00728 public static void Rect(System.Drawing.Rectangle rect)
00729 {
00730 GL.Rect(rect.Left, rect.Top, rect.Right, rect.Bottom);
00731 }
00732
00733 [CLSCompliant(false)]
00734 public static void Rect(ref System.Drawing.RectangleF rect)
00735 {
00736 GL.Rect(rect.Left, rect.Top, rect.Right, rect.Bottom);
00737 }
00738
00739 [CLSCompliant(false)]
00740 public static void Rect(ref System.Drawing.Rectangle rect)
00741 {
00742 GL.Rect(rect.Left, rect.Top, rect.Right, rect.Bottom);
00743 }
00744
00745 #endregion
00746
00747 #region public static int GenTexture()
00748
00749 public static int GenTexture()
00750 {
00751 int id;
00752 GenTextures(1, out id);
00753 return id;
00754 }
00755
00756 #endregion
00757
00758 #region public static void DeleteTexture(int id)
00759
00760 public static void DeleteTexture(int id)
00761 {
00762 DeleteTextures(1, ref id);
00763 }
00764
00765 #endregion
00766
00767 #region [Vertex|Normal|Index|Color|FogCoord|VertexAttrib]Pointer
00768
00769 public static void VertexPointer(int size, VertexPointerType type, int stride, int offset)
00770 {
00771 VertexPointer(size, type, stride, (IntPtr)offset);
00772 }
00773
00774 public static void NormalPointer(NormalPointerType type, int stride, int offset)
00775 {
00776 NormalPointer(type, stride, (IntPtr)offset);
00777 }
00778
00779 public static void IndexPointer(IndexPointerType type, int stride, int offset)
00780 {
00781 IndexPointer(type, stride, (IntPtr)offset);
00782 }
00783
00784 public static void ColorPointer(int size, ColorPointerType type, int stride, int offset)
00785 {
00786 ColorPointer(size, type, stride, (IntPtr)offset);
00787 }
00788
00789 public static void FogCoordPointer(FogPointerType type, int stride, int offset)
00790 {
00791 FogCoordPointer(type, stride, (IntPtr)offset);
00792 }
00793
00794 public static void EdgeFlagPointer(int stride, int offset)
00795 {
00796 EdgeFlagPointer(stride, (IntPtr)offset);
00797 }
00798
00799 public static void TexCoordPointer(int size, TexCoordPointerType type, int stride, int offset)
00800 {
00801 TexCoordPointer(size, type, stride, (IntPtr)offset);
00802 }
00803
00804 public static void VertexAttribPointer(int index, int size, VertexAttribPointerType type, bool normalized, int stride, int offset)
00805 {
00806 VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset);
00807 }
00808
00809 #endregion
00810
00811 #region DrawElements
00812
00813 public static void DrawElements(BeginMode mode, int count, DrawElementsType type, int offset)
00814 {
00815 DrawElements(mode, count, type, new IntPtr(offset));
00816 }
00817
00818 #endregion
00819
00820 #region Get[Float|Double]
00821
00822 public static void GetFloat(GetPName pname, out Vector2 vector)
00823 {
00824 unsafe
00825 {
00826 fixed (Vector2* ptr = &vector)
00827 GetFloat(pname, (float*)ptr);
00828 }
00829 }
00830
00831 public static void GetFloat(GetPName pname, out Vector3 vector)
00832 {
00833 unsafe
00834 {
00835 fixed (Vector3* ptr = &vector)
00836 GetFloat(pname, (float*)ptr);
00837 }
00838 }
00839
00840 public static void GetFloat(GetPName pname, out Vector4 vector)
00841 {
00842 unsafe
00843 {
00844 fixed (Vector4* ptr = &vector)
00845 GetFloat(pname, (float*)ptr);
00846 }
00847 }
00848
00849 public static void GetFloat(GetPName pname, out Matrix4 matrix)
00850 {
00851 unsafe
00852 {
00853 fixed (Matrix4* ptr = &matrix)
00854 GetFloat(pname, (float*)ptr);
00855 }
00856 }
00857
00858 public static void GetDouble(GetPName pname, out Vector2d vector)
00859 {
00860 unsafe
00861 {
00862 fixed (Vector2d* ptr = &vector)
00863 GetDouble(pname, (double*)ptr);
00864 }
00865 }
00866
00867 public static void GetDouble(GetPName pname, out Vector3d vector)
00868 {
00869 unsafe
00870 {
00871 fixed (Vector3d* ptr = &vector)
00872 GetDouble(pname, (double*)ptr);
00873 }
00874 }
00875
00876 public static void GetDouble(GetPName pname, out Vector4d vector)
00877 {
00878 unsafe
00879 {
00880 fixed (Vector4d* ptr = &vector)
00881 GetDouble(pname, (double*)ptr);
00882 }
00883 }
00884
00885 public static void GetDouble(GetPName pname, out Matrix4d matrix)
00886 {
00887 unsafe
00888 {
00889 fixed (Matrix4d* ptr = &matrix)
00890 GetDouble(pname, (double*)ptr);
00891 }
00892 }
00893
00894 #endregion
00895
00896 #region Viewport
00897
00898 public static void Viewport(System.Drawing.Size size)
00899 {
00900 GL.Viewport(0, 0, size.Width, size.Height);
00901 }
00902
00903 public static void Viewport(System.Drawing.Point location, System.Drawing.Size size)
00904 {
00905 GL.Viewport(location.X, location.Y, size.Width, size.Height);
00906 }
00907
00908 public static void Viewport(System.Drawing.Rectangle rectangle)
00909 {
00910 GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
00911 }
00912 #if NO_SYSDRAWING
00913 public static void Viewport(OpenTK.Point location, OpenTK.Size size)
00914 {
00915 GL.Viewport(location.X, location.Y, size.Width, size.Height);
00916 }
00917
00918 public static void Viewport(OpenTK.Rectangle rectangle)
00919 {
00920 GL.Viewport(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
00921 }
00922 #endif
00923 #endregion
00924
00925 #region TexEnv
00926
00927 public static void TexEnv(TextureEnvTarget target, TextureEnvParameter pname, System.Drawing.Color color)
00928 {
00929 Color4 c = new Color4(color);
00930 unsafe
00931 {
00932 TexEnv(target, pname, &c.R);
00933 }
00934 }
00935
00936 public static void TexEnv(TextureEnvTarget target, TextureEnvParameter pname, Color4 color)
00937 {
00938 unsafe
00939 {
00940 TexEnv(target, pname, &color.R);
00941 }
00942 }
00943
00944 #endregion
00945
00946 #region Obsolete
00947
00948 [AutoGenerated(Category = "Version11Deprecated", Version = "1.1", EntryPoint = "glDisableClientState")]
00949 [Obsolete("Use DisableClientState(ArrayCap) instead.")]
00950 public static void DisableClientState(OpenTK.Graphics.OpenGL.EnableCap array)
00951 {
00952 DisableClientState((ArrayCap)array);
00953 }
00954
00955 [AutoGenerated(Category = "Version11Deprecated", Version = "1.1", EntryPoint = "glEnableClientState")]
00956 [Obsolete("Use EnableClientState(ArrayCap) instead.")]
00957 public static void EnableClientState(OpenTK.Graphics.OpenGL.EnableCap array)
00958 {
00959 EnableClientState((ArrayCap)array);
00960 }
00961
00962 [AutoGenerated(Category = "ArbUniformBufferObject", Version = "2.0", EntryPoint = "glGetActiveUniformsiv")]
00963 [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")]
00964 public static void GetActiveUniforms(Int32 program, Int32 uniformCount, Int32[] uniformIndices, ArbUniformBufferObject pname, [OutAttribute] Int32[] @params)
00965 {
00966 GetActiveUniforms(program, uniformCount, uniformIndices, (ActiveUniformParameter)pname, @params);
00967 }
00968
00969 [AutoGenerated(Category = "ArbUniformBufferObject", Version = "2.0", EntryPoint = "glGetActiveUniformsiv")]
00970 [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")]
00971 public static void GetActiveUniforms(Int32 program, Int32 uniformCount, ref Int32 uniformIndices, ArbUniformBufferObject pname, [OutAttribute] out Int32 @params)
00972 {
00973 GetActiveUniforms(program, uniformCount, ref uniformIndices, (ActiveUniformParameter)pname, out @params);
00974 }
00975
00976 [System.CLSCompliant(false)]
00977 [AutoGenerated(Category = "ArbUniformBufferObject", Version = "2.0", EntryPoint = "glGetActiveUniformsiv")]
00978 [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")]
00979 public static unsafe void GetActiveUniforms(Int32 program, Int32 uniformCount, Int32* uniformIndices, ArbUniformBufferObject pname, [OutAttribute] Int32* @params)
00980 {
00981 GetActiveUniforms(program, uniformCount, uniformIndices, (ActiveUniformParameter)pname, @params);
00982 }
00983
00984 [System.CLSCompliant(false)]
00985 [AutoGenerated(Category = "ArbUniformBufferObject", Version = "2.0", EntryPoint = "glGetActiveUniformsiv")]
00986 [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")]
00987 public static void GetActiveUniforms(UInt32 program, Int32 uniformCount, UInt32[] uniformIndices, ArbUniformBufferObject pname, [OutAttribute] Int32[] @params)
00988 {
00989 GetActiveUniforms(program, uniformCount, uniformIndices, (ActiveUniformParameter)pname, @params);
00990 }
00991
00992 [System.CLSCompliant(false)]
00993 [AutoGenerated(Category = "ArbUniformBufferObject", Version = "2.0", EntryPoint = "glGetActiveUniformsiv")]
00994 [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")]
00995 public static void GetActiveUniforms(UInt32 program, Int32 uniformCount, ref UInt32 uniformIndices, ArbUniformBufferObject pname, [OutAttribute] out Int32 @params)
00996 {
00997 GetActiveUniforms(program, uniformCount, ref uniformIndices, (ActiveUniformParameter)pname, out @params);
00998 }
00999
01000 [System.CLSCompliant(false)]
01001 [AutoGenerated(Category = "ArbUniformBufferObject", Version = "2.0", EntryPoint = "glGetActiveUniformsiv")]
01002 [Obsolete("Use GetActiveUniforms(..., ActiveUniformParameter, ...) instead.")]
01003 public static unsafe void GetActiveUniforms(UInt32 program, Int32 uniformCount, UInt32* uniformIndices, ArbUniformBufferObject pname, [OutAttribute] Int32* @params)
01004 {
01005 GetActiveUniforms(program, uniformCount, uniformIndices, (ActiveUniformParameter)pname, @params);
01006 }
01007
01008 #endregion
01009
01010 #pragma warning restore 3019
01011 #pragma warning restore 1591
01012 #pragma warning restore 1572
01013 #pragma warning restore 1573
01014
01015 #endregion
01016 }
01017 }