From 8cd76686d000b2f82664cc90fcb1706947828292 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 11 Oct 2006 21:42:22 +0000 Subject: [PATCH] Preparatory work for linux support (added basic X and GLX bindings) Major update to OpenTK.OpenGL.Bind. Updated OpenGL specs to 2.1 (were 2.0) --- OpenTK.sln | 1 + Source/Examples/OpenGL/GLSL/Lesson01/Cube.cs | 4 +- Source/OpenGL/Bind/Main.cs | 9 +- Source/OpenGL/Bind/Structures/Constant.cs | 3 +- Source/OpenGL/Bind/TranslateSpecs.cs | 46 + Source/OpenGL/Bind/WriteSpecs.cs | 34 +- Source/OpenGL/OpenGL/Bindings/GL.cs | 909 ++++++++++++++---- .../OpenGL/OpenGL/Bindings/GLContextLoad.cs | 13 + Source/OpenGL/OpenGL/Contexts/X11Context.cs | 20 +- Source/OpenGL/OpenGL/Forms/GLForm.cs | 123 ++- Source/OpenGL/OpenGL/Glx.cs | 454 ++++----- Source/Platform/X/XApi.cs | 38 +- changelog.txt | 7 + 13 files changed, 1180 insertions(+), 481 deletions(-) diff --git a/OpenTK.sln b/OpenTK.sln index f58036b1..0c59e8e3 100644 --- a/OpenTK.sln +++ b/OpenTK.sln @@ -49,6 +49,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenGL", "OpenGL", "{2F3FEA EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.OpenGL", "Source\OpenGL\OpenGL\OpenTK.OpenGL.csproj", "{836876D1-0C8D-4240-BEE4-859D9D3D46CB}" ProjectSection(ProjectDependencies) = postProject + {1EDDE592-3923-4898-9006-3D69579E1745} = {1EDDE592-3923-4898-9006-3D69579E1745} {FDFA00B6-FA81-4658-86E1-F312EFB42E1C} = {FDFA00B6-FA81-4658-86E1-F312EFB42E1C} EndProjectSection EndProject diff --git a/Source/Examples/OpenGL/GLSL/Lesson01/Cube.cs b/Source/Examples/OpenGL/GLSL/Lesson01/Cube.cs index 97bd2632..a29c53d8 100644 --- a/Source/Examples/OpenGL/GLSL/Lesson01/Cube.cs +++ b/Source/Examples/OpenGL/GLSL/Lesson01/Cube.cs @@ -10,7 +10,7 @@ using OpenTK.OpenGL; namespace OpenTK.Examples.OpenGL.GLSL { - public partial class Cube : GLForm + public partial class Cube : Framework { #region Shaders string[] vertex_shader_source = @@ -125,7 +125,7 @@ namespace OpenTK.Examples.OpenGL.GLSL DrawCube(); Context.SwapBuffers(); - this.Invalidate(); + //this.Invalidate(); } #endregion diff --git a/Source/OpenGL/Bind/Main.cs b/Source/OpenGL/Bind/Main.cs index a03e121a..12c0d112 100644 --- a/Source/OpenGL/Bind/Main.cs +++ b/Source/OpenGL/Bind/Main.cs @@ -73,6 +73,10 @@ namespace OpenTK.OpenGL.Bind long ticks = System.DateTime.Now.Ticks; // GL binding generation. + + Translation.GLTypes = SpecReader.ReadTypeMap("gl.tm"); + Translation.CSTypes = SpecReader.ReadTypeMap("csharp.tm"); + List wrappers; List functions = SpecReader.ReadFunctionSpecs("gl.spec"); Hashtable enums = SpecReader.ReadEnumSpecs("enum.spec"); @@ -87,9 +91,6 @@ namespace OpenTK.OpenGL.Bind ((Enum)enums[e.Name]).ConstantCollection.Add(c.Name, c); } - Translation.GLTypes = SpecReader.ReadTypeMap("gl.tm"); - Translation.CSTypes = SpecReader.ReadTypeMap("csharp.tm"); - Translation.TranslateFunctions(functions, enums, out wrappers); Translation.TranslateEnums(enums); @@ -102,7 +103,7 @@ namespace OpenTK.OpenGL.Bind // GLX binding generation. //Translation.GLXTypes = SpecReader.ReadTypeMap("glx.tm"); // Works semi-ok. - //functions = SpecReader.ReadFunctionSpecs("glx.spec"); // Works ok! + //List functions = SpecReader.ReadFunctionSpecs("glx.spec"); // Works ok! //Hashtable enums = SpecReader.ReadEnumSpecs("glxenum.spec"); // Works ok! //SpecWriter.WriteSpecs(Settings.OutputPath, "Glx", functions, null, enums); // Needs updating. diff --git a/Source/OpenGL/Bind/Structures/Constant.cs b/Source/OpenGL/Bind/Structures/Constant.cs index 67fae7a6..f91b36ea 100644 --- a/Source/OpenGL/Bind/Structures/Constant.cs +++ b/Source/OpenGL/Bind/Structures/Constant.cs @@ -11,7 +11,8 @@ namespace OpenTK.OpenGL.Bind { /// /// Represents an opengl constant in C# format. Both the constant name and value - /// can be retrieved or set. All opengl constants are translated to 'const uint'. + /// can be retrieved or set. The value can be either a number, another constant + /// or an alias to a constant /// public class Constant { diff --git a/Source/OpenGL/Bind/TranslateSpecs.cs b/Source/OpenGL/Bind/TranslateSpecs.cs index c2cbe9fa..adb1eaba 100644 --- a/Source/OpenGL/Bind/TranslateSpecs.cs +++ b/Source/OpenGL/Bind/TranslateSpecs.cs @@ -104,6 +104,28 @@ namespace OpenTK.OpenGL.Bind public static void TranslateEnums(System.Collections.Hashtable enums) { + // Add missing enums. + { + Enum e = new Enum(); + Constant c; + e.Name = "SGIX_icc_texture"; + c = new Constant("RGB_ICC_SGIX", "0x8460"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("RGBA_ICC_SGIX", "0x8461"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("ALPHA_ICC_SGIX", "0x8462"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("LUMINANCE_ICC_SGIX", "0x8463"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("INTENSITY_ICC_SGIX", "0x8464"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("LUMINANCE_ALPHA_ICC_SGIX", "0x8465"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("R5_G6_B5_ICC_SGIX", "0x8466"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("R5_G6_B5_A8_ICC_SGIX", "0x8467"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("ALPHA16_ICC_SGIX", "0x8468"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("LUMINANCE16_ICC_SGIX", "0x8469"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("INTENSITY16_ICC_SGIX", "0x846A"); e.ConstantCollection.Add(c.Name, c); + c = new Constant("LUMINANCE16_ALPHA8_ICC_SGIX", "0x846B"); e.ConstantCollection.Add(c.Name, c); + + enums.Add(e.Name, e); + } + + // Translate enums. foreach (Enum e in enums.Values) { if (Char.IsDigit(e.Name[0])) @@ -114,13 +136,37 @@ namespace OpenTK.OpenGL.Bind foreach (Constant c in e.ConstantCollection.Values) { + // Prepend an '_' if the first letter is a number (e.g. 4_BYTES -> _4_BYTES) if (Char.IsDigit(c.Name[0])) c.Name = c.Name.Insert(0, "_"); + // Prepend an '_' to the aliased value, if it starts with a number (e.g. DataType.4_BYTES -> DataType._4_BYTES) if (c.Value.Contains(".") && Char.IsDigit(c.Value[c.Value.IndexOf('.') + 1])) c.Value = c.Value.Insert(c.Value.IndexOf('.') + 1, "_"); + + // There are cases when a value is not a number but an aliased constant, with no enum specified. + // In this case try searching all enums for the correct constant to alias (stupid opengl group). + if (!c.Value.Contains(".") && !c.Value.StartsWith("0x") && !Char.IsDigit(c.Value[0])) + { + if (c.Value.StartsWith("GL_")) + c.Value = c.Value.TrimStart('G', 'L', '_'); + + if (Char.IsDigit(c.Value[0])) + c.Value = c.Value.Insert(0, "_"); + + foreach (Enum search_enum in enums.Values) + foreach (Constant search_constant in search_enum.ConstantCollection.Values) + if (search_constant.Name == c.Value || search_constant.Name == c.Value.TrimStart('_')) + c.Value = c.Value.Insert(0, search_enum.Name + "."); + } + + // Handle enum.spec bugs: + if (c.Value.Contains("LightProperty")) + c.Value = c.Value.Replace("LightProperty", "LightParameter"); } } + + } #endregion diff --git a/Source/OpenGL/Bind/WriteSpecs.cs b/Source/OpenGL/Bind/WriteSpecs.cs index 74a15ef2..beafea73 100644 --- a/Source/OpenGL/Bind/WriteSpecs.cs +++ b/Source/OpenGL/Bind/WriteSpecs.cs @@ -67,6 +67,7 @@ namespace OpenTK.OpenGL.Bind #endregion #region Write types + private static void WriteTypes(StreamWriter sw) { sw.WriteLine(" #region Types"); @@ -79,6 +80,7 @@ namespace OpenTK.OpenGL.Bind sw.WriteLine(" #endregion"); sw.WriteLine(); } + #endregion #region Write enums @@ -93,38 +95,6 @@ namespace OpenTK.OpenGL.Bind sw.WriteLine(" #region Missing Constants"); sw.WriteLine(); - // Version 1.4 enum - sw.WriteLine(" const uint GL_FOG_COORDINATE_SOURCE = 0x8450;"); - sw.WriteLine(" const uint GL_FOG_COORDINATE = 0x8451;"); - sw.WriteLine(" const uint GL_CURRENT_FOG_COORDINATE = 0x8453;"); - sw.WriteLine(" const uint GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454;"); - sw.WriteLine(" const uint GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455;"); - sw.WriteLine(" const uint GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456;"); - sw.WriteLine(" const uint GL_FOG_COORDINATE_ARRAY = 0x8457;"); - - // Version 1.5 enum - sw.WriteLine(" const uint GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D;"); - - // Version 1.3 enum - sw.WriteLine(" const uint GL_SOURCE0_RGB = 0x8580;"); - sw.WriteLine(" const uint GL_SOURCE1_RGB = 0x8581;"); - sw.WriteLine(" const uint GL_SOURCE2_RGB = 0x8582;"); - sw.WriteLine(" const uint GL_SOURCE0_ALPHA = 0x8588;"); - sw.WriteLine(" const uint GL_SOURCE1_ALPHA = 0x8589;"); - sw.WriteLine(" const uint GL_SOURCE2_ALPHA = 0x858A;"); - - // Version 2.0 enum - sw.WriteLine(" const uint GL_BLEND_EQUATION = 0x8009;"); - - sw.WriteLine(" const uint GL_MODELVIEW_MATRIX = 0x0BA6;"); - sw.WriteLine(" const uint GL_MODELVIEW = 0x1700;"); - sw.WriteLine(" const uint GL_MODELVIEW_STACK_DEPTH = 0x0BA3;"); - - // NV_texture_shader enum - sw.WriteLine(" const uint GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1;"); - sw.WriteLine(" const uint GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2;"); - sw.WriteLine(" const uint GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3;"); - sw.WriteLine(); sw.WriteLine(" #endregion"); sw.WriteLine(); diff --git a/Source/OpenGL/OpenGL/Bindings/GL.cs b/Source/OpenGL/OpenGL/Bindings/GL.cs index cf8af278..cac720a5 100644 --- a/Source/OpenGL/OpenGL/Bindings/GL.cs +++ b/Source/OpenGL/OpenGL/Bindings/GL.cs @@ -34,6 +34,10 @@ namespace OpenTK.OpenGL using GLdouble = System.Double; using GLclampd = System.Double; using GLstring = System.String; + using GLint64EXT = System.Int64; + using GLuint64EXT = System.Int64; + using GLint64 = System.Int64; + using GLuint64 = System.Int64; #endregion #region Enums @@ -41,27 +45,6 @@ namespace OpenTK.OpenGL { #region Missing Constants - const uint GL_FOG_COORDINATE_SOURCE = 0x8450; - const uint GL_FOG_COORDINATE = 0x8451; - const uint GL_CURRENT_FOG_COORDINATE = 0x8453; - const uint GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454; - const uint GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455; - const uint GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456; - const uint GL_FOG_COORDINATE_ARRAY = 0x8457; - const uint GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D; - const uint GL_SOURCE0_RGB = 0x8580; - const uint GL_SOURCE1_RGB = 0x8581; - const uint GL_SOURCE2_RGB = 0x8582; - const uint GL_SOURCE0_ALPHA = 0x8588; - const uint GL_SOURCE1_ALPHA = 0x8589; - const uint GL_SOURCE2_ALPHA = 0x858A; - const uint GL_BLEND_EQUATION = 0x8009; - const uint GL_MODELVIEW_MATRIX = 0x0BA6; - const uint GL_MODELVIEW = 0x1700; - const uint GL_MODELVIEW_STACK_DEPTH = 0x0BA3; - const uint GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1; - const uint GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2; - const uint GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3; #endregion @@ -194,6 +177,10 @@ namespace OpenTK.OpenGL MAX_ASYNC_READ_PIXELS_SGIX = 0x8361, } + public enum ARB_texture_env_add : uint + { + } + public enum BeginMode : uint { QUAD_STRIP = 0x0008, @@ -418,6 +405,7 @@ namespace OpenTK.OpenGL public enum SGIX_blend_alpha_minmax : uint { ALPHA_MAX_SGIX = 0x8321, + ASYNC_MARKER_SGIX = 0x8329, ALPHA_MIN_SGIX = 0x8320, } @@ -609,8 +597,83 @@ namespace OpenTK.OpenGL MINMAX_FORMAT_EXT = EXT_histogram.MINMAX_FORMAT_EXT, } - public enum IBM_multimode_draw_arrays : uint + public enum ARB_imaging : uint { + CONVOLUTION_WIDTH = 0x8018, + COLOR_MATRIX_STACK_DEPTH = 0x80B2, + BLEND_EQUATION = 0x8009, + COLOR_TABLE_BIAS = 0x80D7, + CONSTANT_BORDER = 0x8151, + HISTOGRAM = 0x8024, + COLOR_TABLE_GREEN_SIZE = 0x80DB, + HISTOGRAM_RED_SIZE = 0x8028, + CONSTANT_ALPHA = 0x8003, + TABLE_TOO_LARGE = 0x8031, + POST_CONVOLUTION_GREEN_SCALE = 0x801D, + MINMAX_SINK = 0x8030, + PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5, + COLOR_TABLE_SCALE = 0x80D6, + COLOR_MATRIX = 0x80B1, + CONVOLUTION_FILTER_SCALE = 0x8014, + BLEND_COLOR = 0x8005, + MIN = 0x8007, + HISTOGRAM_SINK = 0x802D, + POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5, + SEPARABLE_2D = 0x8012, + FUNC_REVERSE_SUBTRACT = 0x800B, + CONVOLUTION_FORMAT = 0x8017, + REPLICATE_BORDER = 0x8153, + CONSTANT_COLOR = 0x8001, + COLOR_TABLE = 0x80D0, + POST_CONVOLUTION_BLUE_SCALE = 0x801E, + FUNC_ADD = 0x8006, + CONVOLUTION_2D = 0x8011, + POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB, + POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7, + MINMAX = 0x802E, + POST_CONVOLUTION_ALPHA_BIAS = 0x8023, + POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6, + POST_COLOR_MATRIX_RED_BIAS = 0x80B8, + HISTOGRAM_BLUE_SIZE = 0x802A, + POST_CONVOLUTION_BLUE_BIAS = 0x8022, + COLOR_TABLE_FORMAT = 0x80D8, + POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2, + CONVOLUTION_HEIGHT = 0x8019, + POST_CONVOLUTION_COLOR_TABLE = 0x80D1, + MINMAX_FORMAT = 0x802F, + COLOR_TABLE_ALPHA_SIZE = 0x80DD, + POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA, + PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4, + PROXY_COLOR_TABLE = 0x80D3, + HISTOGRAM_ALPHA_SIZE = 0x802B, + MAX_CONVOLUTION_WIDTH = 0x801A, + POST_COLOR_MATRIX_RED_SCALE = 0x80B4, + POST_CONVOLUTION_ALPHA_SCALE = 0x801F, + CONVOLUTION_BORDER_COLOR = 0x8154, + COLOR_TABLE_BLUE_SIZE = 0x80DC, + ONE_MINUS_CONSTANT_COLOR = 0x8002, + COLOR_TABLE_LUMINANCE_SIZE = 0x80DE, + POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9, + ONE_MINUS_CONSTANT_ALPHA = 0x8004, + FUNC_SUBTRACT = 0x800A, + COLOR_TABLE_INTENSITY_SIZE = 0x80DF, + REDUCE = 0x8016, + COLOR_TABLE_RED_SIZE = 0x80DA, + CONVOLUTION_BORDER_MODE = 0x8013, + HISTOGRAM_GREEN_SIZE = 0x8029, + POST_CONVOLUTION_GREEN_BIAS = 0x8021, + HISTOGRAM_FORMAT = 0x8027, + CONVOLUTION_1D = 0x8010, + POST_CONVOLUTION_RED_BIAS = 0x8020, + MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3, + COLOR_TABLE_WIDTH = 0x80D9, + POST_CONVOLUTION_RED_SCALE = 0x801C, + MAX = 0x8008, + PROXY_HISTOGRAM = 0x8025, + MAX_CONVOLUTION_HEIGHT = 0x801B, + CONVOLUTION_FILTER_BIAS = 0x8015, + HISTOGRAM_WIDTH = 0x8026, + HISTOGRAM_LUMINANCE_SIZE = 0x802C, } public enum NV_vertex_program2_option : uint @@ -750,6 +813,14 @@ namespace OpenTK.OpenGL TEXTURE_DEFORMATION_SGIX = SGIX_polynomial_ffd.TEXTURE_DEFORMATION_SGIX, } + public enum EXT_framebuffer_blit : uint + { + DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CAA, + READ_FRAMEBUFFER_BINDING_EXT = EXT_framebuffer_object.FRAMEBUFFER_BINDING_EXT, + READ_FRAMEBUFFER_EXT = 0x8CA8, + DRAW_FRAMEBUFFER_EXT = 0x8CA9, + } + public enum EnableCap : uint { MAP1_VERTEX_3 = GetPName.MAP1_VERTEX_3, @@ -1065,12 +1136,6 @@ namespace OpenTK.OpenGL POST_CONVOLUTION_GREEN_BIAS = 0x8021, } - public enum EXT_depth_bounds_test : uint - { - DEPTH_BOUNDS_EXT = 0x8891, - DEPTH_BOUNDS_TEST_EXT = 0x8890, - } - public enum MaterialParameter : uint { EMISSION = 0x1600, @@ -1102,14 +1167,9 @@ namespace OpenTK.OpenGL REPLICATE_BORDER = 0x8153, } - public enum APPLE_vertex_array_range : uint + public enum NV_vertex_program3 : uint { - STORAGE_SHARED_APPLE = 0x85BF, - VERTEX_ARRAY_RANGE_APPLE = 0x851D, - VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F, - VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E, - VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521, - STORAGE_CACHED_APPLE = 0x85BE, + MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = ARB_vertex_shader.MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, } public enum NV_blend_square : uint @@ -1367,43 +1427,43 @@ namespace OpenTK.OpenGL DYNAMIC_READ = 0x88E9, VERTEX_ARRAY_BUFFER_BINDING = 0x8896, STREAM_COPY = 0x88E2, - FOG_COORD_ARRAY_STRIDE = GL_FOG_COORDINATE_ARRAY_STRIDE, + FOG_COORD_ARRAY_STRIDE = VERSION_1_4.FOG_COORDINATE_ARRAY_STRIDE, FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D, READ_WRITE = 0x88BA, - SRC1_ALPHA = GL_SOURCE1_ALPHA, + SRC1_ALPHA = VERSION_1_3.SOURCE1_ALPHA, TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A, BUFFER_MAP_POINTER = 0x88BD, QUERY_COUNTER_BITS = 0x8864, STATIC_COPY = 0x88E6, STATIC_DRAW = 0x88E4, - SRC2_RGB = GL_SOURCE2_RGB, - SRC2_ALPHA = GL_SOURCE2_ALPHA, - FOG_COORD_ARRAY = GL_FOG_COORDINATE_ARRAY, - FOG_COORD_SRC = GL_FOG_COORDINATE_SOURCE, + SRC2_RGB = VERSION_1_3.SOURCE2_RGB, + SRC2_ALPHA = VERSION_1_3.SOURCE2_ALPHA, + FOG_COORD_ARRAY = VERSION_1_4.FOG_COORDINATE_ARRAY, + FOG_COORD_SRC = VERSION_1_4.FOG_COORDINATE_SOURCE, DYNAMIC_COPY = 0x88EA, STATIC_READ = 0x88E5, - FOG_COORD_ARRAY_BUFFER_BINDING = GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING, - FOG_COORD_ARRAY_POINTER = GL_FOG_COORDINATE_ARRAY_POINTER, + FOG_COORD_ARRAY_BUFFER_BINDING = VERSION_1_5.FOG_COORDINATE_ARRAY_BUFFER_BINDING, + FOG_COORD_ARRAY_POINTER = VERSION_1_4.FOG_COORDINATE_ARRAY_POINTER, EDGE_FLAG_ARRAY_BUFFER_BINDING = 0x889B, - CURRENT_FOG_COORD = GL_CURRENT_FOG_COORDINATE, + CURRENT_FOG_COORD = VERSION_1_4.CURRENT_FOG_COORDINATE, VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F, READ_ONLY = 0x88B8, - SRC0_ALPHA = GL_SOURCE0_ALPHA, + SRC0_ALPHA = VERSION_1_3.SOURCE0_ALPHA, ELEMENT_ARRAY_BUFFER = 0x8893, CURRENT_QUERY = 0x8865, - FOG_COORD = GL_FOG_COORDINATE, + FOG_COORD = VERSION_1_4.FOG_COORDINATE, QUERY_RESULT = 0x8866, BUFFER_USAGE = 0x8765, BUFFER_ACCESS = 0x88BB, STREAM_DRAW = 0x88E0, SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 0x889C, - SRC0_RGB = GL_SOURCE0_RGB, + SRC0_RGB = VERSION_1_3.SOURCE0_RGB, ARRAY_BUFFER_BINDING = 0x8894, QUERY_RESULT_AVAILABLE = 0x8867, WRITE_ONLY = 0x88B9, BUFFER_SIZE = 0x8764, WEIGHT_ARRAY_BUFFER_BINDING = 0x889E, - SRC1_RGB = GL_SOURCE1_RGB, + SRC1_RGB = VERSION_1_3.SOURCE1_RGB, SAMPLES_PASSED = 0x8914, DYNAMIC_DRAW = 0x88E8, ARRAY_BUFFER = 0x8892, @@ -1413,7 +1473,7 @@ namespace OpenTK.OpenGL BUFFER_MAPPED = 0x88BC, ELEMENT_ARRAY_BUFFER_BINDING = 0x8895, STREAM_READ = 0x88E1, - FOG_COORD_ARRAY_TYPE = GL_FOG_COORDINATE_ARRAY_TYPE, + FOG_COORD_ARRAY_TYPE = VERSION_1_4.FOG_COORDINATE_ARRAY_TYPE, } public enum ErrorCode : uint @@ -1586,6 +1646,10 @@ namespace OpenTK.OpenGL _3D = 0x0601, } + public enum GREMEDY_string_marker : uint + { + } + public enum ARB_point_sprite : uint { POINT_SPRITE_ARB = 0x8861, @@ -1636,10 +1700,31 @@ namespace OpenTK.OpenGL PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355, } - public enum SUNX_constant_data : uint + public enum VERSION_2_1 : uint { - TEXTURE_CONSTANT_DATA_SUNX = 0x81D6, - UNPACK_CONSTANT_DATA_SUNX = 0x81D5, + FLOAT_MAT3x2 = 0x8B67, + SRGB8 = 0x8C41, + FLOAT_MAT3x4 = 0x8B68, + COMPRESSED_SRGB_ALPHA = 0x8C49, + FLOAT_MAT4x3 = 0x8B6A, + SLUMINANCE_ALPHA = 0x8C44, + PIXEL_UNPACK_BUFFER = 0x88EC, + SRGB_ALPHA = 0x8C42, + COMPRESSED_SLUMINANCE = 0x8C4A, + FLOAT_MAT4x2 = 0x8B69, + SRGB8_ALPHA8 = 0x8C43, + COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B, + PIXEL_UNPACK_BUFFER_BINDING = 0x88EF, + PIXEL_PACK_BUFFER = 0x88EB, + FLOAT_MAT2x3 = 0x8B65, + COMPRESSED_SRGB = 0x8C48, + PIXEL_PACK_BUFFER_BINDING = 0x88ED, + SRGB = 0x8C40, + SLUMINANCE8 = 0x8C47, + SLUMINANCE = 0x8C46, + FLOAT_MAT2x4 = 0x8B66, + SLUMINANCE8_ALPHA8 = 0x8C45, + CURRENT_RASTER_SECONDARY_COLOR = 0x845F, } public enum APPLE_ycbcr_422 : uint @@ -1772,6 +1857,13 @@ namespace OpenTK.OpenGL TEXTURE_POST_SPECULAR_HP = 0x8168, } + public enum ARB_shadow : uint + { + TEXTURE_COMPARE_MODE_ARB = 0x884C, + TEXTURE_COMPARE_FUNC_ARB = 0x884D, + COMPARE_R_TO_TEXTURE_ARB = 0x884E, + } + public enum SGIS_texture4D : uint { TEXTURE_4D_BINDING_SGIS = 0x814F, @@ -1831,7 +1923,7 @@ namespace OpenTK.OpenGL public enum EXT_blend_equation_separate : uint { - BLEND_EQUATION_RGB_EXT = GL_BLEND_EQUATION, + BLEND_EQUATION_RGB_EXT = ARB_imaging.BLEND_EQUATION, BLEND_EQUATION_ALPHA_EXT = 0x883D, } @@ -2513,6 +2605,10 @@ namespace OpenTK.OpenGL TEXTURE_COLOR_WRITEMASK_SGIS = 0x81EF, } + public enum SGIX_flush_raster : uint + { + } + public enum SGIX_ycrcb_subsample : uint { PIXEL_SUBSAMPLE_2424_SGIX = 0x85A3, @@ -2619,6 +2715,10 @@ namespace OpenTK.OpenGL { } + public enum IBM_multimode_draw_arrays : uint + { + } + public enum SGI_color_matrix : uint { POST_COLOR_MATRIX_RED_BIAS_SGI = 0x80B8, @@ -2695,11 +2795,8 @@ namespace OpenTK.OpenGL ASYNC_HISTOGRAM_SGIX = 0x832C, } - public enum ARB_shadow : uint + public enum EXT_gpu_program_parameters : uint { - TEXTURE_COMPARE_MODE_ARB = 0x884C, - TEXTURE_COMPARE_FUNC_ARB = 0x884D, - COMPARE_R_TO_TEXTURE_ARB = 0x884E, } public enum EXT_clip_volume_hint : uint @@ -3071,6 +3168,12 @@ namespace OpenTK.OpenGL INDEX_MATERIAL_PARAMETER_EXT = 0x81B9, } + public enum EXT_stencil_clear_tag : uint + { + STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3, + STENCIL_TAG_BITS_EXT = 0x88F2, + } + public enum EXT_framebuffer_object : uint { FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC, @@ -3083,24 +3186,25 @@ namespace OpenTK.OpenGL COLOR_ATTACHMENT13_EXT = 0x8CED, RENDERBUFFER_HEIGHT_EXT = 0x8D43, COLOR_ATTACHMENT14_EXT = 0x8CEE, - FRAMEBUFFER_COMPLETE_EXT = 0x8CD5, + COLOR_ATTACHMENT12_EXT = 0x8CEC, RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44, + RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53, FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9, - FRAMEBUFFER_STATUS_ERROR_EXT = 0x8CDE, STENCIL_INDEX4_EXT = 0x8D47, FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2, COLOR_ATTACHMENT6_EXT = 0x8CE6, - STENCIL_INDEX_EXT = 0x8D45, FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7, FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA, + RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54, FRAMEBUFFER_BINDING_EXT = 0x8CA6, COLOR_ATTACHMENT8_EXT = 0x8CE8, + FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6, COLOR_ATTACHMENT2_EXT = 0x8CE2, COLOR_ATTACHMENT9_EXT = 0x8CE9, FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3, FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB, - COLOR_ATTACHMENT12_EXT = 0x8CEC, MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF, + RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51, STENCIL_INDEX8_EXT = 0x8D48, COLOR_ATTACHMENT7_EXT = 0x8CE7, MAX_RENDERBUFFER_SIZE_EXT = 0x84E8, @@ -3108,17 +3212,20 @@ namespace OpenTK.OpenGL DEPTH_ATTACHMENT_EXT = 0x8D00, COLOR_ATTACHMENT0_EXT = 0x8CE0, INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506, + RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52, FRAMEBUFFER_EXT = 0x8D40, RENDERBUFFER_WIDTH_EXT = 0x8D42, + STENCIL_INDEX16_EXT = 0x8D49, FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT = 0x8CD8, - FRAMEBUFFER_INCOMPLETE_ATTACHMENTS_EXT = 0x8CD6, COLOR_ATTACHMENT5_EXT = 0x8CE5, FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD, + RENDERBUFFER_RED_SIZE_EXT = 0x8D50, COLOR_ATTACHMENT11_EXT = 0x8CEB, - STENCIL_INDEX16_EXT = 0x8D49, + FRAMEBUFFER_COMPLETE_EXT = 0x8CD5, COLOR_ATTACHMENT4_EXT = 0x8CE4, COLOR_ATTACHMENT10_EXT = 0x8CEA, RENDERBUFFER_BINDING_EXT = 0x8CA7, + RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55, FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1, STENCIL_ATTACHMENT_EXT = 0x8D20, } @@ -3349,7 +3456,7 @@ namespace OpenTK.OpenGL SAMPLER_2D_SHADOW = 0x8B62, VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A, FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B, - BLEND_EQUATION_RGB = GL_BLEND_EQUATION, + BLEND_EQUATION_RGB = ARB_imaging.BLEND_EQUATION, DRAW_BUFFER2 = 0x8827, SHADER_SOURCE_LENGTH = 0x8B88, DRAW_BUFFER7 = 0x882C, @@ -3611,83 +3718,14 @@ namespace OpenTK.OpenGL HALF_FLOAT_NV = 0x140B, } - public enum ARB_imaging : uint + public enum APPLE_vertex_array_range : uint { - CONVOLUTION_WIDTH = 0x8018, - COLOR_MATRIX_STACK_DEPTH = 0x80B2, - BLEND_EQUATION = 0x8009, - COLOR_TABLE_BIAS = 0x80D7, - CONSTANT_BORDER = 0x8151, - HISTOGRAM = 0x8024, - COLOR_TABLE_GREEN_SIZE = 0x80DB, - HISTOGRAM_RED_SIZE = 0x8028, - CONSTANT_ALPHA = 0x8003, - TABLE_TOO_LARGE = 0x8031, - POST_CONVOLUTION_GREEN_SCALE = 0x801D, - MINMAX_SINK = 0x8030, - PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5, - COLOR_TABLE_SCALE = 0x80D6, - COLOR_MATRIX = 0x80B1, - CONVOLUTION_FILTER_SCALE = 0x8014, - BLEND_COLOR = 0x8005, - MIN = 0x8007, - HISTOGRAM_SINK = 0x802D, - POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5, - SEPARABLE_2D = 0x8012, - FUNC_REVERSE_SUBTRACT = 0x800B, - CONVOLUTION_FORMAT = 0x8017, - REPLICATE_BORDER = 0x8153, - CONSTANT_COLOR = 0x8001, - COLOR_TABLE = 0x80D0, - POST_CONVOLUTION_BLUE_SCALE = 0x801E, - FUNC_ADD = 0x8006, - CONVOLUTION_2D = 0x8011, - POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB, - POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7, - MINMAX = 0x802E, - POST_CONVOLUTION_ALPHA_BIAS = 0x8023, - POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6, - POST_COLOR_MATRIX_RED_BIAS = 0x80B8, - HISTOGRAM_BLUE_SIZE = 0x802A, - POST_CONVOLUTION_BLUE_BIAS = 0x8022, - COLOR_TABLE_FORMAT = 0x80D8, - POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2, - CONVOLUTION_HEIGHT = 0x8019, - POST_CONVOLUTION_COLOR_TABLE = 0x80D1, - MINMAX_FORMAT = 0x802F, - COLOR_TABLE_ALPHA_SIZE = 0x80DD, - POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA, - PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4, - PROXY_COLOR_TABLE = 0x80D3, - HISTOGRAM_ALPHA_SIZE = 0x802B, - MAX_CONVOLUTION_WIDTH = 0x801A, - POST_COLOR_MATRIX_RED_SCALE = 0x80B4, - POST_CONVOLUTION_ALPHA_SCALE = 0x801F, - CONVOLUTION_BORDER_COLOR = 0x8154, - COLOR_TABLE_BLUE_SIZE = 0x80DC, - ONE_MINUS_CONSTANT_COLOR = 0x8002, - COLOR_TABLE_LUMINANCE_SIZE = 0x80DE, - POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9, - ONE_MINUS_CONSTANT_ALPHA = 0x8004, - FUNC_SUBTRACT = 0x800A, - COLOR_TABLE_INTENSITY_SIZE = 0x80DF, - REDUCE = 0x8016, - COLOR_TABLE_RED_SIZE = 0x80DA, - CONVOLUTION_BORDER_MODE = 0x8013, - HISTOGRAM_GREEN_SIZE = 0x8029, - POST_CONVOLUTION_GREEN_BIAS = 0x8021, - HISTOGRAM_FORMAT = 0x8027, - CONVOLUTION_1D = 0x8010, - POST_CONVOLUTION_RED_BIAS = 0x8020, - MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3, - COLOR_TABLE_WIDTH = 0x80D9, - POST_CONVOLUTION_RED_SCALE = 0x801C, - MAX = 0x8008, - PROXY_HISTOGRAM = 0x8025, - MAX_CONVOLUTION_HEIGHT = 0x801B, - CONVOLUTION_FILTER_BIAS = 0x8015, - HISTOGRAM_WIDTH = 0x8026, - HISTOGRAM_LUMINANCE_SIZE = 0x802C, + STORAGE_SHARED_APPLE = 0x85BF, + VERTEX_ARRAY_RANGE_APPLE = 0x851D, + VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F, + VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E, + VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521, + STORAGE_CACHED_APPLE = 0x85BE, } public enum NV_texture_compression_vtc : uint @@ -3785,9 +3823,10 @@ namespace OpenTK.OpenGL SHADOW_AMBIENT_SGIX = 0x80BF, } - public enum NV_vertex_program3 : uint + public enum SUNX_constant_data : uint { - MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = ARB_vertex_shader.MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, + TEXTURE_CONSTANT_DATA_SUNX = 0x81D6, + UNPACK_CONSTANT_DATA_SUNX = 0x81D5, } public enum EXT_blend_minmax : uint @@ -3876,20 +3915,10 @@ namespace OpenTK.OpenGL MAX_SHININESS_NV = 0x8504, } - public enum SGIX_icc_texture : uint + public enum EXT_depth_bounds_test : uint { - RGBA_ICC_SGIX = 0x8461, - INTENSITY_ICC_SGIX = 0x8464, - ALPHA_ICC_SGIX = 0x8462, - LUMINANCE_ICC_SGIX = 0x8463, - LUMINANCE16_ICC_SGIX = 0x8469, - R5_G6_B5_ICC_SGIX = 0x8466, - ALPHA16_ICC_SGIX = 0x8468, - INTENSITY16_ICC_SGIX = 0x846A, - RGB_ICC_SGIX = 0x8460, - LUMINANCE_ALPHA_ICC_SGIX = 0x8465, - R5_G6_B5_A8_ICC_SGIX = 0x8467, - LUMINANCE16_ALPHA8_ICC_SGIX = 0x846B, + DEPTH_BOUNDS_EXT = 0x8891, + DEPTH_BOUNDS_TEST_EXT = 0x8890, } public enum ARB_texture_float : uint @@ -4058,8 +4087,12 @@ namespace OpenTK.OpenGL POINT_SIZE_MIN_ARB = 0x8126, } - public enum ARB_texture_env_add : uint + public enum EXT_packed_depth_stencil : uint { + DEPTH_STENCIL_EXT = 0x84F9, + TEXTURE_STENCIL_SIZE_EXT = 0x88F1, + UNSIGNED_INT_24_8_EXT = 0x84FA, + DEPTH24_STENCIL8_EXT = 0x88F0, } public enum EXT_color_subtable : uint @@ -4409,7 +4442,7 @@ namespace OpenTK.OpenGL OFFSET_TEXTURE_SCALE_NV = 0x86E2, MAGNITUDE_SCALE_NV = 0x8712, CULL_FRAGMENT_NV = 0x86E7, - OFFSET_TEXTURE_2D_SCALE_NV = GL_OFFSET_TEXTURE_SCALE_NV, + OFFSET_TEXTURE_2D_SCALE_NV = NV_texture_shader.OFFSET_TEXTURE_SCALE_NV, TEXTURE_DT_SIZE_NV = 0x871E, OFFSET_TEXTURE_2D_NV = 0x86E8, UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA, @@ -4431,7 +4464,7 @@ namespace OpenTK.OpenGL DT_BIAS_NV = 0x8717, SIGNED_LUMINANCE_ALPHA_NV = 0x8703, OFFSET_TEXTURE_BIAS_NV = 0x86E3, - OFFSET_TEXTURE_2D_MATRIX_NV = GL_OFFSET_TEXTURE_MATRIX_NV, + OFFSET_TEXTURE_2D_MATRIX_NV = NV_texture_shader.OFFSET_TEXTURE_MATRIX_NV, HILO16_NV = 0x86F8, TEXTURE_BORDER_VALUES_NV = 0x871A, SIGNED_ALPHA_NV = 0x8705, @@ -4459,7 +4492,7 @@ namespace OpenTK.OpenGL PASS_THROUGH_NV = 0x86E6, DSDT_NV = 0x86F5, SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C, - OFFSET_TEXTURE_2D_BIAS_NV = GL_OFFSET_TEXTURE_BIAS_NV, + OFFSET_TEXTURE_2D_BIAS_NV = NV_texture_shader.OFFSET_TEXTURE_BIAS_NV, TEXTURE_MAG_SIZE_NV = 0x871F, SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704, SIGNED_HILO16_NV = 0x86FA, @@ -4660,18 +4693,18 @@ namespace OpenTK.OpenGL public enum EXT_vertex_weighting : uint { CURRENT_VERTEX_WEIGHT_EXT = 0x850B, - MODELVIEW0_MATRIX_EXT = GL_MODELVIEW_MATRIX, + MODELVIEW0_MATRIX_EXT = GetPName.MODELVIEW_MATRIX, VERTEX_WEIGHT_ARRAY_EXT = 0x850C, MODELVIEW1_MATRIX_EXT = 0x8506, VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E, VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F, MODELVIEW1_EXT = 0x850A, VERTEX_WEIGHTING_EXT = 0x8509, - MODELVIEW0_EXT = GL_MODELVIEW, + MODELVIEW0_EXT = MatrixMode.MODELVIEW, MODELVIEW1_STACK_DEPTH_EXT = 0x8502, VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510, VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D, - MODELVIEW0_STACK_DEPTH_EXT = GL_MODELVIEW_STACK_DEPTH, + MODELVIEW0_STACK_DEPTH_EXT = GetPName.MODELVIEW_STACK_DEPTH, } public enum ATI_pn_triangles : uint @@ -4819,6 +4852,11 @@ namespace OpenTK.OpenGL PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED, } + public enum EXT_framebuffer_multisample : uint + { + RENDERBUFFER_SAMPLES_EXT = 0x8CAB, + } + public enum ATI_texture_mirror_once : uint { MIRROR_CLAMP_ATI = 0x8742, @@ -5018,6 +5056,26 @@ namespace OpenTK.OpenGL FULL_RANGE_EXT = 0x87E1, } + public enum EXT_texture_sRGB : uint + { + COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F, + SRGB8_EXT = 0x8C41, + SLUMINANCE8_ALPHA8_EXT = 0x8C45, + COMPRESSED_SRGB_ALPHA_EXT = 0x8C49, + SLUMINANCE_EXT = 0x8C46, + COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C, + SLUMINANCE_ALPHA_EXT = 0x8C44, + COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D, + SRGB8_ALPHA8_EXT = 0x8C43, + SRGB_ALPHA_EXT = 0x8C42, + SRGB_EXT = 0x8C40, + COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E, + SLUMINANCE8_EXT = 0x8C47, + COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B, + COMPRESSED_SRGB_EXT = 0x8C48, + COMPRESSED_SLUMINANCE_EXT = 0x8C4A, + } + public enum ClipPlaneName : uint { CLIP_PLANE3 = 0x3003, @@ -5084,6 +5142,22 @@ namespace OpenTK.OpenGL LESS = AlphaFunction.LESS, } + public enum SGIX_icc_texture : uint + { + RGBA_ICC_SGIX = 0x8461, + INTENSITY_ICC_SGIX = 0x8464, + ALPHA_ICC_SGIX = 0x8462, + LUMINANCE_ICC_SGIX = 0x8463, + LUMINANCE16_ICC_SGIX = 0x8469, + R5_G6_B5_ICC_SGIX = 0x8466, + ALPHA16_ICC_SGIX = 0x8468, + INTENSITY16_ICC_SGIX = 0x846A, + RGB_ICC_SGIX = 0x8460, + LUMINANCE_ALPHA_ICC_SGIX = 0x8465, + R5_G6_B5_A8_ICC_SGIX = 0x8467, + LUMINANCE16_ALPHA8_ICC_SGIX = 0x846B, + } + public enum VERSION_1_2 : uint { TEXTURE_BASE_LEVEL = 0x813C, @@ -5139,8 +5213,19 @@ namespace OpenTK.OpenGL ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8, } - public enum SGIX_flush_raster : uint + public enum MESAX_texture_stack : uint { + TEXTURE_1D_STACK_MESAX = 0x8759, + PROXY_TEXTURE_2D_STACK_MESAX = 0x875C, + TEXTURE_2D_STACK_MESAX = 0x875A, + TEXTURE_1D_STACK_BINDING_MESAX = 0x875D, + PROXY_TEXTURE_1D_STACK_MESAX = 0x875B, + TEXTURE_2D_STACK_BINDING_MESAX = 0x875E, + } + + public enum EXT_timer_query : uint + { + TIME_ELAPSED_EXT = 0x88BF, } } @@ -5729,6 +5814,12 @@ namespace OpenTK.OpenGL public delegate void VertexAttrib4uiv_(GLuint index, IntPtr v); public delegate void VertexAttrib4usv_(GLuint index, IntPtr v); public delegate void VertexAttribPointer_(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, IntPtr pointer); + public delegate void UniformMatrix2x3fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + public delegate void UniformMatrix3x2fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + public delegate void UniformMatrix2x4fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + public delegate void UniformMatrix4x2fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + public delegate void UniformMatrix3x4fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + public delegate void UniformMatrix4x3fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); public delegate void ActiveTextureARB(GLenum texture); public delegate void ClientActiveTextureARB(GLenum texture); public delegate void MultiTexCoord1dARB(GLenum target, GLdouble s); @@ -6574,6 +6665,13 @@ namespace OpenTK.OpenGL public delegate void GetFramebufferAttachmentParameterivEXT_(Enums.EXT_framebuffer_object target, Enums.EXT_framebuffer_object attachment, Enums.EXT_framebuffer_object pname, IntPtr parameters); public delegate void GenerateMipmapEXT(Enums.EXT_framebuffer_object target); public delegate void StringMarkerGREMEDY_(GLsizei len, IntPtr @string); + public delegate void StencilClearTagEXT(GLsizei stencilTagBits, GLuint stencilClearTag); + public delegate void BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, Enums.ClearBufferMask mask, Enums.EXT_framebuffer_blit filter); + public delegate void RenderbufferStorageMultisampleEXT(Enums.EXT_framebuffer_multisample target, GLsizei samples, Enums.EXT_framebuffer_multisample internalformat, GLsizei width, GLsizei height); + public delegate void GetQueryObjecti64vEXT_(GLuint id, Enums.EXT_timer_query pname, IntPtr parameters); + public delegate void GetQueryObjectui64vEXT_(GLuint id, Enums.EXT_timer_query pname, IntPtr parameters); + public delegate void ProgramEnvParameters4fvEXT_(GLenum target, GLuint index, GLsizei count, IntPtr parameters); + public delegate void ProgramLocalParameters4fvEXT_(GLenum target, GLuint index, GLsizei count, IntPtr parameters); } #endregion @@ -7735,6 +7833,18 @@ namespace OpenTK.OpenGL public static extern void VertexAttrib4usv_(GLuint index, IntPtr v); [DllImport("opengl32.dll", EntryPoint = "glVertexAttribPointer")] public static extern void VertexAttribPointer_(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, IntPtr pointer); + [DllImport("opengl32.dll", EntryPoint = "glUniformMatrix2x3fv")] + public static extern void UniformMatrix2x3fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + [DllImport("opengl32.dll", EntryPoint = "glUniformMatrix3x2fv")] + public static extern void UniformMatrix3x2fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + [DllImport("opengl32.dll", EntryPoint = "glUniformMatrix2x4fv")] + public static extern void UniformMatrix2x4fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + [DllImport("opengl32.dll", EntryPoint = "glUniformMatrix4x2fv")] + public static extern void UniformMatrix4x2fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + [DllImport("opengl32.dll", EntryPoint = "glUniformMatrix3x4fv")] + public static extern void UniformMatrix3x4fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); + [DllImport("opengl32.dll", EntryPoint = "glUniformMatrix4x3fv")] + public static extern void UniformMatrix4x3fv_(GLint location, GLsizei count, GLboolean transpose, IntPtr value); } #endregion @@ -8317,6 +8427,12 @@ namespace OpenTK.OpenGL public static Delegates.VertexAttrib4uiv_ VertexAttrib4uiv_; public static Delegates.VertexAttrib4usv_ VertexAttrib4usv_; public static Delegates.VertexAttribPointer_ VertexAttribPointer_; + public static Delegates.UniformMatrix2x3fv_ UniformMatrix2x3fv_; + public static Delegates.UniformMatrix3x2fv_ UniformMatrix3x2fv_; + public static Delegates.UniformMatrix2x4fv_ UniformMatrix2x4fv_; + public static Delegates.UniformMatrix4x2fv_ UniformMatrix4x2fv_; + public static Delegates.UniformMatrix3x4fv_ UniformMatrix3x4fv_; + public static Delegates.UniformMatrix4x3fv_ UniformMatrix4x3fv_; public static Delegates.ActiveTextureARB ActiveTextureARB; public static Delegates.ClientActiveTextureARB ClientActiveTextureARB; public static Delegates.MultiTexCoord1dARB MultiTexCoord1dARB; @@ -9162,6 +9278,13 @@ namespace OpenTK.OpenGL public static Delegates.GetFramebufferAttachmentParameterivEXT_ GetFramebufferAttachmentParameterivEXT_; public static Delegates.GenerateMipmapEXT GenerateMipmapEXT; public static Delegates.StringMarkerGREMEDY_ StringMarkerGREMEDY_; + public static Delegates.StencilClearTagEXT StencilClearTagEXT; + public static Delegates.BlitFramebufferEXT BlitFramebufferEXT; + public static Delegates.RenderbufferStorageMultisampleEXT RenderbufferStorageMultisampleEXT; + public static Delegates.GetQueryObjecti64vEXT_ GetQueryObjecti64vEXT_; + public static Delegates.GetQueryObjectui64vEXT_ GetQueryObjectui64vEXT_; + public static Delegates.ProgramEnvParameters4fvEXT_ ProgramEnvParameters4fvEXT_; + public static Delegates.ProgramLocalParameters4fvEXT_ ProgramLocalParameters4fvEXT_; #endregion @@ -23993,6 +24116,282 @@ namespace OpenTK.OpenGL #endregion + #region UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + + public static + void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + { + UniformMatrix2x3fv_(location, count, transpose, value); + } + + #endregion + + #region UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, object value) + + public static + void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, object value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix2x3fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + + public static + void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix2x3fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + + public static + void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + { + UniformMatrix3x2fv_(location, count, transpose, value); + } + + #endregion + + #region UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, object value) + + public static + void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, object value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix3x2fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + + public static + void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix3x2fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + + public static + void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + { + UniformMatrix2x4fv_(location, count, transpose, value); + } + + #endregion + + #region UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, object value) + + public static + void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, object value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix2x4fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + + public static + void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix2x4fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + + public static + void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + { + UniformMatrix4x2fv_(location, count, transpose, value); + } + + #endregion + + #region UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, object value) + + public static + void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, object value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix4x2fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + + public static + void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix4x2fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + + public static + void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + { + UniformMatrix3x4fv_(location, count, transpose, value); + } + + #endregion + + #region UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, object value) + + public static + void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, object value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix3x4fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + + public static + void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix3x4fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + + public static + void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, IntPtr value) + { + UniformMatrix4x3fv_(location, count, transpose, value); + } + + #endregion + + #region UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, object value) + + public static + void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, object value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix4x3fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + + public static + void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, GLfloat[] value) + { + GCHandle h0 = GCHandle.Alloc(value, GCHandleType.Pinned); + try + { + UniformMatrix4x3fv_(location, count, transpose, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + #region MultiTexCoord1dvARB(GLenum target, IntPtr v) public static @@ -64815,6 +65214,190 @@ namespace OpenTK.OpenGL #endregion + #region GetQueryObjecti64vEXT(GLuint id, Enums.EXT_timer_query pname, IntPtr parameters) + + public static + void GetQueryObjecti64vEXT(GLuint id, Enums.EXT_timer_query pname, IntPtr parameters) + { + GetQueryObjecti64vEXT_(id, pname, parameters); + } + + #endregion + + #region GetQueryObjecti64vEXT(GLuint id, Enums.EXT_timer_query pname, object parameters) + + public static + void GetQueryObjecti64vEXT(GLuint id, Enums.EXT_timer_query pname, object parameters) + { + GCHandle h0 = GCHandle.Alloc(parameters, GCHandleType.Pinned); + try + { + GetQueryObjecti64vEXT_(id, pname, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region GetQueryObjecti64vEXT(GLuint id, Enums.EXT_timer_query pname, GLint64[] parameters) + + public static + void GetQueryObjecti64vEXT(GLuint id, Enums.EXT_timer_query pname, GLint64[] parameters) + { + GCHandle h0 = GCHandle.Alloc(parameters, GCHandleType.Pinned); + try + { + GetQueryObjecti64vEXT_(id, pname, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region GetQueryObjectui64vEXT(GLuint id, Enums.EXT_timer_query pname, IntPtr parameters) + + public static + void GetQueryObjectui64vEXT(GLuint id, Enums.EXT_timer_query pname, IntPtr parameters) + { + GetQueryObjectui64vEXT_(id, pname, parameters); + } + + #endregion + + #region GetQueryObjectui64vEXT(GLuint id, Enums.EXT_timer_query pname, object parameters) + + public static + void GetQueryObjectui64vEXT(GLuint id, Enums.EXT_timer_query pname, object parameters) + { + GCHandle h0 = GCHandle.Alloc(parameters, GCHandleType.Pinned); + try + { + GetQueryObjectui64vEXT_(id, pname, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region GetQueryObjectui64vEXT(GLuint id, Enums.EXT_timer_query pname, GLuint64[] parameters) + + public static + void GetQueryObjectui64vEXT(GLuint id, Enums.EXT_timer_query pname, GLuint64[] parameters) + { + GCHandle h0 = GCHandle.Alloc(parameters, GCHandleType.Pinned); + try + { + GetQueryObjectui64vEXT_(id, pname, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, IntPtr parameters) + + public static + void ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, IntPtr parameters) + { + ProgramEnvParameters4fvEXT_(target, index, count, parameters); + } + + #endregion + + #region ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, object parameters) + + public static + void ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, object parameters) + { + GCHandle h0 = GCHandle.Alloc(parameters, GCHandleType.Pinned); + try + { + ProgramEnvParameters4fvEXT_(target, index, count, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, GLfloat[] parameters) + + public static + void ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, GLfloat[] parameters) + { + GCHandle h0 = GCHandle.Alloc(parameters, GCHandleType.Pinned); + try + { + ProgramEnvParameters4fvEXT_(target, index, count, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, IntPtr parameters) + + public static + void ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, IntPtr parameters) + { + ProgramLocalParameters4fvEXT_(target, index, count, parameters); + } + + #endregion + + #region ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, object parameters) + + public static + void ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, object parameters) + { + GCHandle h0 = GCHandle.Alloc(parameters, GCHandleType.Pinned); + try + { + ProgramLocalParameters4fvEXT_(target, index, count, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + + #region ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, GLfloat[] parameters) + + public static + void ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, GLfloat[] parameters) + { + GCHandle h0 = GCHandle.Alloc(parameters, GCHandleType.Pinned); + try + { + ProgramLocalParameters4fvEXT_(target, index, count, h0.AddrOfPinnedObject()); + } + finally + { + h0.Free(); + } + } + + #endregion + #endregion } } diff --git a/Source/OpenGL/OpenGL/Bindings/GLContextLoad.cs b/Source/OpenGL/OpenGL/Bindings/GLContextLoad.cs index 24cf2a45..70c70d30 100644 --- a/Source/OpenGL/OpenGL/Bindings/GLContextLoad.cs +++ b/Source/OpenGL/OpenGL/Bindings/GLContextLoad.cs @@ -591,6 +591,12 @@ namespace OpenTK.OpenGL GL.VertexAttrib4uiv_ = (GL.Delegates.VertexAttrib4uiv_)GetAddress("glVertexAttrib4uiv", typeof(GL.Delegates.VertexAttrib4uiv_)); GL.VertexAttrib4usv_ = (GL.Delegates.VertexAttrib4usv_)GetAddress("glVertexAttrib4usv", typeof(GL.Delegates.VertexAttrib4usv_)); GL.VertexAttribPointer_ = (GL.Delegates.VertexAttribPointer_)GetAddress("glVertexAttribPointer", typeof(GL.Delegates.VertexAttribPointer_)); + GL.UniformMatrix2x3fv_ = (GL.Delegates.UniformMatrix2x3fv_)GetAddress("glUniformMatrix2x3fv", typeof(GL.Delegates.UniformMatrix2x3fv_)); + GL.UniformMatrix3x2fv_ = (GL.Delegates.UniformMatrix3x2fv_)GetAddress("glUniformMatrix3x2fv", typeof(GL.Delegates.UniformMatrix3x2fv_)); + GL.UniformMatrix2x4fv_ = (GL.Delegates.UniformMatrix2x4fv_)GetAddress("glUniformMatrix2x4fv", typeof(GL.Delegates.UniformMatrix2x4fv_)); + GL.UniformMatrix4x2fv_ = (GL.Delegates.UniformMatrix4x2fv_)GetAddress("glUniformMatrix4x2fv", typeof(GL.Delegates.UniformMatrix4x2fv_)); + GL.UniformMatrix3x4fv_ = (GL.Delegates.UniformMatrix3x4fv_)GetAddress("glUniformMatrix3x4fv", typeof(GL.Delegates.UniformMatrix3x4fv_)); + GL.UniformMatrix4x3fv_ = (GL.Delegates.UniformMatrix4x3fv_)GetAddress("glUniformMatrix4x3fv", typeof(GL.Delegates.UniformMatrix4x3fv_)); GL.ActiveTextureARB = (GL.Delegates.ActiveTextureARB)GetAddress("glActiveTextureARB", typeof(GL.Delegates.ActiveTextureARB)); GL.ClientActiveTextureARB = (GL.Delegates.ClientActiveTextureARB)GetAddress("glClientActiveTextureARB", typeof(GL.Delegates.ClientActiveTextureARB)); GL.MultiTexCoord1dARB = (GL.Delegates.MultiTexCoord1dARB)GetAddress("glMultiTexCoord1dARB", typeof(GL.Delegates.MultiTexCoord1dARB)); @@ -1436,6 +1442,13 @@ namespace OpenTK.OpenGL GL.GetFramebufferAttachmentParameterivEXT_ = (GL.Delegates.GetFramebufferAttachmentParameterivEXT_)GetAddress("glGetFramebufferAttachmentParameterivEXT", typeof(GL.Delegates.GetFramebufferAttachmentParameterivEXT_)); GL.GenerateMipmapEXT = (GL.Delegates.GenerateMipmapEXT)GetAddress("glGenerateMipmapEXT", typeof(GL.Delegates.GenerateMipmapEXT)); GL.StringMarkerGREMEDY_ = (GL.Delegates.StringMarkerGREMEDY_)GetAddress("glStringMarkerGREMEDY", typeof(GL.Delegates.StringMarkerGREMEDY_)); + GL.StencilClearTagEXT = (GL.Delegates.StencilClearTagEXT)GetAddress("glStencilClearTagEXT", typeof(GL.Delegates.StencilClearTagEXT)); + GL.BlitFramebufferEXT = (GL.Delegates.BlitFramebufferEXT)GetAddress("glBlitFramebufferEXT", typeof(GL.Delegates.BlitFramebufferEXT)); + GL.RenderbufferStorageMultisampleEXT = (GL.Delegates.RenderbufferStorageMultisampleEXT)GetAddress("glRenderbufferStorageMultisampleEXT", typeof(GL.Delegates.RenderbufferStorageMultisampleEXT)); + GL.GetQueryObjecti64vEXT_ = (GL.Delegates.GetQueryObjecti64vEXT_)GetAddress("glGetQueryObjecti64vEXT", typeof(GL.Delegates.GetQueryObjecti64vEXT_)); + GL.GetQueryObjectui64vEXT_ = (GL.Delegates.GetQueryObjectui64vEXT_)GetAddress("glGetQueryObjectui64vEXT", typeof(GL.Delegates.GetQueryObjectui64vEXT_)); + GL.ProgramEnvParameters4fvEXT_ = (GL.Delegates.ProgramEnvParameters4fvEXT_)GetAddress("glProgramEnvParameters4fvEXT", typeof(GL.Delegates.ProgramEnvParameters4fvEXT_)); + GL.ProgramLocalParameters4fvEXT_ = (GL.Delegates.ProgramLocalParameters4fvEXT_)GetAddress("glProgramLocalParameters4fvEXT", typeof(GL.Delegates.ProgramLocalParameters4fvEXT_)); } #endregion } diff --git a/Source/OpenGL/OpenGL/Contexts/X11Context.cs b/Source/OpenGL/OpenGL/Contexts/X11Context.cs index 9c51bdce..f769f284 100644 --- a/Source/OpenGL/OpenGL/Contexts/X11Context.cs +++ b/Source/OpenGL/OpenGL/Contexts/X11Context.cs @@ -9,19 +9,31 @@ using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; +using OpenTK.Platform.X; namespace OpenTK.OpenGL.Platform { public partial class X11Context : OpenTK.OpenGL.GLContext { - int drawable, context; + int drawable; + IntPtr context; + IntPtr display; const string _dll_name = "opengl.so"; public X11Context(Control c, int red, int green, int blue, int alpha, int depth, int stencil) { + //drawable = c.Handle.ToInt32(); + display = Api.OpenDisplay("OpenTK X11 trial"); + Api.VisualInfo visual = Glx.ChooseVisual(display, 0, new int[] { }); + context = Glx.CreateContext(display, visual, IntPtr.Zero, true); + //Api.Free(new IntPtr(visual)); drawable = c.Handle.ToInt32(); + Glx.MakeCurrent(drawable, context); + + //context = Glx.CreateContext( + //X11Context - throw new Exception("The method or operation is not implemented."); + //throw new Exception("The method or operation is not implemented."); } public override void SwapBuffers() @@ -45,7 +57,9 @@ namespace OpenTK.OpenGL.Platform public override void Dispose() { - throw new Exception("The method or operation is not implemented."); + //throw new Exception("The method or operation is not implemented."); + Glx.DestroyContext(context); + Api.CloseDisplay(display); } } } diff --git a/Source/OpenGL/OpenGL/Forms/GLForm.cs b/Source/OpenGL/OpenGL/Forms/GLForm.cs index e4218741..b1942576 100644 --- a/Source/OpenGL/OpenGL/Forms/GLForm.cs +++ b/Source/OpenGL/OpenGL/Forms/GLForm.cs @@ -12,10 +12,11 @@ using System.Drawing; using System.Threading; using OpenTK.Platform.Windows; using System.Runtime.InteropServices; +using OpenTK.OpenGL.Platform; namespace OpenTK.OpenGL { - public class GLForm : Form, IDisposable + public class Framework : Form, IDisposable { #region Context private GLContext _context; @@ -27,14 +28,51 @@ namespace OpenTK.OpenGL } #endregion + delegate bool IsIdleDelegate(); + IsIdleDelegate IsIdle; + #region Constructors - public GLForm() + + public Framework() { Open(null, 640, 480, 8, 8, 8, 8, 16, 0, false); } + + public Framework(string title, int width, int height, int red, int green, int blue, int alpha, int depth, int stencil, bool fullscreen) + { + Open(title, width, height, red, green, blue, alpha, depth, stencil, fullscreen); + } + #endregion public void Open(string title, int width, int height, int red, int green, int blue, int alpha, int depth, int stencil, bool fullscreen) + { + Application.Idle += new EventHandler(OnIdle); + + try + { + if (Environment.OSVersion.Platform == PlatformID.Win32NT || + Environment.OSVersion.Platform == PlatformID.Win32Windows) + { + IsIdle = new IsIdleDelegate(WindowsIsIdle); + WindowsOpen(title, width, height, red, green, blue, alpha, depth, stencil, fullscreen); + } + else if (Environment.OSVersion.Platform == PlatformID.Unix) + { + IsIdle = new IsIdleDelegate(XIsIdle); + } + else + { + throw new PlatformNotSupportedException("The platform on which you are trying to run this program is not currently supported. Sorry for the inconvenience."); + } + } + catch (Exception e) + { + MessageBox.Show(e.ToString()); + } + } + + public void WindowsOpen(string title, int width, int height, int red, int green, int blue, int alpha, int depth, int stencil, bool fullscreen) { // Hack! Should add more constructors to the GLContext class. Context = GLContext.Create(this, 8, 8, 8, 8, 16, 0); @@ -81,74 +119,55 @@ namespace OpenTK.OpenGL this.Size = new Size(width, height); // Cross-platformness? - Application.Idle += new EventHandler(OnApplicationIdle); + } - #region Application main loop + //override protected void WndProc(ref Message m) + //{ + // base.WndProc(ref m); + // //OnPaint(null); + //} + + #region IDisposable Members + + void IDisposable.Dispose() + { + Application.Idle -= OnIdle; + } + + #endregion + + + #region Event Handlers + /// /// Called when all pending messages have been processed, this is where the application 'Main Loop' resides. /// /// Not used. /// Not used. - void OnApplicationIdle(object sender, EventArgs e) + private void OnIdle(object sender, EventArgs e) { - // Check if any new messages have popped up. If not, then run the logic at full speed. - //while (IsApplicationIdle()) - ////while (idle) - //{ - // // We'd like to play nice with the scheduler. If the window is not in focus, - // // we give back some thread-time to the OS, to allow other apps to function full-speed. - // // However, if the window _is_ in focus we grab all processor resources. - // // Hack! Should allow the user to set a sleep interval. - // if (ActiveForm != this) - // Thread.Sleep(100); - // OnPaint(null); - //} + while (IsIdle()) + { + if (ActiveForm != this) + Thread.Sleep(100); + OnPaint(null); + } } /// /// Checks if there all pending messages have been processed. /// /// Returns true if there are no messages left, false otherwise. - static public bool IsApplicationIdle() + private bool WindowsIsIdle() { - //Message msg = Message.Create(this.Handle, A - - //try - //{ - //Message msg; - Api.Message msg; - return !OpenTK.Platform.Windows.Api.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0); - //} - //catch (Exception e) - //{ - // //MessageBox.Show(e.ToString()); - // return false; - //} - //WndProc(ref msg); - - //if (msg. - //return false; - - //Message msg = Message.Create(IntPtr.Zero, Api.Constants.WM_ENTERIDLE, IntPtr.Zero, IntPtr.Zero); - - //return !Api.PeekMessage(ref msg, IntPtr.Zero, 0, 0, 0); - } - #endregion - - bool idle; - - protected override void WndProc(ref Message m) - { - base.WndProc(ref m); - //OnPaint(null); + Api.Message msg; + return !OpenTK.Platform.Windows.Api.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0); } - #region IDisposable Members - - void IDisposable.Dispose() + private bool XIsIdle() { - Application.Idle -= OnApplicationIdle; + throw new NotImplementedException("IsIdle handler not implemented yet!"); } #endregion diff --git a/Source/OpenGL/OpenGL/Glx.cs b/Source/OpenGL/OpenGL/Glx.cs index d6a083fa..1c097046 100644 --- a/Source/OpenGL/OpenGL/Glx.cs +++ b/Source/OpenGL/OpenGL/Glx.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; +using OpenTK.Platform.X; namespace OpenTK.OpenGL { @@ -43,243 +44,250 @@ namespace OpenTK.OpenGL /// public class Glx { - const string _dll_name = "glx.so"; + const string _dll_name = "libgl"; #region Enums - public struct Enums - { - public enum GLXAttribute : uint + public struct Enums { - TRANSPARENT_BLUE_VALUE_EXT = 0x27, - GRAY_SCALE = 0x8006, - RGBA_TYPE = 0x8014, - TRANSPARENT_RGB_EXT = 0x8008, - ACCUM_BLUE_SIZE = 16, - SHARE_CONTEXT_EXT = 0x800A, - STEREO = 6, - ALPHA_SIZE = 11, - FLOAT_COMPONENTS_NV = 0x20B0, - NONE = 0x8000, - DEPTH_SIZE = 12, - TRANSPARENT_INDEX_VALUE_EXT = 0x24, - MAX_PBUFFER_WIDTH_SGIX = 0x8016, - GREEN_SIZE = 9, - X_RENDERABLE_SGIX = 0x8012, - LARGEST_PBUFFER = 0x801C, - DONT_CARE = 0xFFFFFFFF, - TRANSPARENT_ALPHA_VALUE_EXT = 0x28, - PSEUDO_COLOR_EXT = 0x8004, - USE_GL = 1, - SAMPLE_BUFFERS_SGIS = 100000, - TRANSPARENT_GREEN_VALUE_EXT = 0x26, - HYPERPIPE_ID_SGIX = 0x8030, - COLOR_INDEX_TYPE_SGIX = 0x8015, - SLOW_CONFIG = 0x8001, - PRESERVED_CONTENTS = 0x801B, - ACCUM_RED_SIZE = 14, - EVENT_MASK = 0x801F, - VISUAL_ID_EXT = 0x800B, - EVENT_MASK_SGIX = 0x801F, - SLOW_VISUAL_EXT = 0x8001, - TRANSPARENT_GREEN_VALUE = 0x26, - MAX_PBUFFER_WIDTH = 0x8016, - DIRECT_COLOR_EXT = 0x8003, - VISUAL_ID = 0x800B, - ACCUM_GREEN_SIZE = 15, - DRAWABLE_TYPE_SGIX = 0x8010, - SCREEN_EXT = 0x800C, - SAMPLES = 100001, - HEIGHT = 0x801E, - TRANSPARENT_INDEX_VALUE = 0x24, - SAMPLE_BUFFERS_ARB = 100000, - PBUFFER = 0x8023, - RGBA_TYPE_SGIX = 0x8014, - MAX_PBUFFER_HEIGHT = 0x8017, - FBCONFIG_ID_SGIX = 0x8013, - DRAWABLE_TYPE = 0x8010, - SCREEN = 0x800C, - RED_SIZE = 8, - VISUAL_SELECT_GROUP_SGIX = 0x8028, - VISUAL_CAVEAT_EXT = 0x20, - PSEUDO_COLOR = 0x8004, - PBUFFER_HEIGHT = 0x8040, - STATIC_GRAY = 0x8007, - PRESERVED_CONTENTS_SGIX = 0x801B, - RGBA_FLOAT_TYPE_ARB = 0x20B9, - TRANSPARENT_RED_VALUE = 0x25, - TRANSPARENT_ALPHA_VALUE = 0x28, - WINDOW = 0x8022, - X_RENDERABLE = 0x8012, - STENCIL_SIZE = 13, - TRANSPARENT_RGB = 0x8008, - LARGEST_PBUFFER_SGIX = 0x801C, - STATIC_GRAY_EXT = 0x8007, - TRANSPARENT_BLUE_VALUE = 0x27, - DIGITAL_MEDIA_PBUFFER_SGIX = 0x8024, - BLENDED_RGBA_SGIS = 0x8025, - NON_CONFORMANT_VISUAL_EXT = 0x800D, - COLOR_INDEX_TYPE = 0x8015, - TRANSPARENT_RED_VALUE_EXT = 0x25, - GRAY_SCALE_EXT = 0x8006, - WINDOW_SGIX = 0x8022, - X_VISUAL_TYPE = 0x22, - MAX_PBUFFER_HEIGHT_SGIX = 0x8017, - DOUBLEBUFFER = 5, - OPTIMAL_PBUFFER_WIDTH_SGIX = 0x8019, - X_VISUAL_TYPE_EXT = 0x22, - WIDTH_SGIX = 0x801D, - STATIC_COLOR_EXT = 0x8005, - BUFFER_SIZE = 2, - DIRECT_COLOR = 0x8003, - MAX_PBUFFER_PIXELS = 0x8018, - NONE_EXT = 0x8000, - HEIGHT_SGIX = 0x801E, - RENDER_TYPE = 0x8011, - FBCONFIG_ID = 0x8013, - TRANSPARENT_INDEX_EXT = 0x8009, - TRANSPARENT_INDEX = 0x8009, - TRANSPARENT_TYPE_EXT = 0x23, - ACCUM_ALPHA_SIZE = 17, - PBUFFER_SGIX = 0x8023, - MAX_PBUFFER_PIXELS_SGIX = 0x8018, - OPTIMAL_PBUFFER_HEIGHT_SGIX = 0x801A, - DAMAGED = 0x8020, - SAVED_SGIX = 0x8021, - TRANSPARENT_TYPE = 0x23, - MULTISAMPLE_SUB_RECT_WIDTH_SGIS = 0x8026, - NON_CONFORMANT_CONFIG = 0x800D, - BLUE_SIZE = 10, - TRUE_COLOR_EXT = 0x8002, - SAMPLES_SGIS = 100001, - SAMPLES_ARB = 100001, - TRUE_COLOR = 0x8002, - RGBA = 4, - AUX_BUFFERS = 7, - SAMPLE_BUFFERS = 100000, - SAVED = 0x8021, - MULTISAMPLE_SUB_RECT_HEIGHT_SGIS = 0x8027, - DAMAGED_SGIX = 0x8020, - STATIC_COLOR = 0x8005, - PBUFFER_WIDTH = 0x8041, - WIDTH = 0x801D, - LEVEL = 3, - CONFIG_CAVEAT = 0x20, - RENDER_TYPE_SGIX = 0x8011, + public enum GLXAttribute : uint + { + TRANSPARENT_BLUE_VALUE_EXT = 0x27, + GRAY_SCALE = 0x8006, + RGBA_TYPE = 0x8014, + TRANSPARENT_RGB_EXT = 0x8008, + ACCUM_BLUE_SIZE = 16, + SHARE_CONTEXT_EXT = 0x800A, + STEREO = 6, + ALPHA_SIZE = 11, + FLOAT_COMPONENTS_NV = 0x20B0, + NONE = 0x8000, + DEPTH_SIZE = 12, + TRANSPARENT_INDEX_VALUE_EXT = 0x24, + MAX_PBUFFER_WIDTH_SGIX = 0x8016, + GREEN_SIZE = 9, + X_RENDERABLE_SGIX = 0x8012, + LARGEST_PBUFFER = 0x801C, + DONT_CARE = 0xFFFFFFFF, + TRANSPARENT_ALPHA_VALUE_EXT = 0x28, + PSEUDO_COLOR_EXT = 0x8004, + USE_GL = 1, + SAMPLE_BUFFERS_SGIS = 100000, + TRANSPARENT_GREEN_VALUE_EXT = 0x26, + HYPERPIPE_ID_SGIX = 0x8030, + COLOR_INDEX_TYPE_SGIX = 0x8015, + SLOW_CONFIG = 0x8001, + PRESERVED_CONTENTS = 0x801B, + ACCUM_RED_SIZE = 14, + EVENT_MASK = 0x801F, + VISUAL_ID_EXT = 0x800B, + EVENT_MASK_SGIX = 0x801F, + SLOW_VISUAL_EXT = 0x8001, + TRANSPARENT_GREEN_VALUE = 0x26, + MAX_PBUFFER_WIDTH = 0x8016, + DIRECT_COLOR_EXT = 0x8003, + VISUAL_ID = 0x800B, + ACCUM_GREEN_SIZE = 15, + DRAWABLE_TYPE_SGIX = 0x8010, + SCREEN_EXT = 0x800C, + SAMPLES = 100001, + HEIGHT = 0x801E, + TRANSPARENT_INDEX_VALUE = 0x24, + SAMPLE_BUFFERS_ARB = 100000, + PBUFFER = 0x8023, + RGBA_TYPE_SGIX = 0x8014, + MAX_PBUFFER_HEIGHT = 0x8017, + FBCONFIG_ID_SGIX = 0x8013, + DRAWABLE_TYPE = 0x8010, + SCREEN = 0x800C, + RED_SIZE = 8, + VISUAL_SELECT_GROUP_SGIX = 0x8028, + VISUAL_CAVEAT_EXT = 0x20, + PSEUDO_COLOR = 0x8004, + PBUFFER_HEIGHT = 0x8040, + STATIC_GRAY = 0x8007, + PRESERVED_CONTENTS_SGIX = 0x801B, + RGBA_FLOAT_TYPE_ARB = 0x20B9, + TRANSPARENT_RED_VALUE = 0x25, + TRANSPARENT_ALPHA_VALUE = 0x28, + WINDOW = 0x8022, + X_RENDERABLE = 0x8012, + STENCIL_SIZE = 13, + TRANSPARENT_RGB = 0x8008, + LARGEST_PBUFFER_SGIX = 0x801C, + STATIC_GRAY_EXT = 0x8007, + TRANSPARENT_BLUE_VALUE = 0x27, + DIGITAL_MEDIA_PBUFFER_SGIX = 0x8024, + BLENDED_RGBA_SGIS = 0x8025, + NON_CONFORMANT_VISUAL_EXT = 0x800D, + COLOR_INDEX_TYPE = 0x8015, + TRANSPARENT_RED_VALUE_EXT = 0x25, + GRAY_SCALE_EXT = 0x8006, + WINDOW_SGIX = 0x8022, + X_VISUAL_TYPE = 0x22, + MAX_PBUFFER_HEIGHT_SGIX = 0x8017, + DOUBLEBUFFER = 5, + OPTIMAL_PBUFFER_WIDTH_SGIX = 0x8019, + X_VISUAL_TYPE_EXT = 0x22, + WIDTH_SGIX = 0x801D, + STATIC_COLOR_EXT = 0x8005, + BUFFER_SIZE = 2, + DIRECT_COLOR = 0x8003, + MAX_PBUFFER_PIXELS = 0x8018, + NONE_EXT = 0x8000, + HEIGHT_SGIX = 0x801E, + RENDER_TYPE = 0x8011, + FBCONFIG_ID = 0x8013, + TRANSPARENT_INDEX_EXT = 0x8009, + TRANSPARENT_INDEX = 0x8009, + TRANSPARENT_TYPE_EXT = 0x23, + ACCUM_ALPHA_SIZE = 17, + PBUFFER_SGIX = 0x8023, + MAX_PBUFFER_PIXELS_SGIX = 0x8018, + OPTIMAL_PBUFFER_HEIGHT_SGIX = 0x801A, + DAMAGED = 0x8020, + SAVED_SGIX = 0x8021, + TRANSPARENT_TYPE = 0x23, + MULTISAMPLE_SUB_RECT_WIDTH_SGIS = 0x8026, + NON_CONFORMANT_CONFIG = 0x800D, + BLUE_SIZE = 10, + TRUE_COLOR_EXT = 0x8002, + SAMPLES_SGIS = 100001, + SAMPLES_ARB = 100001, + TRUE_COLOR = 0x8002, + RGBA = 4, + AUX_BUFFERS = 7, + SAMPLE_BUFFERS = 100000, + SAVED = 0x8021, + MULTISAMPLE_SUB_RECT_HEIGHT_SGIS = 0x8027, + DAMAGED_SGIX = 0x8020, + STATIC_COLOR = 0x8005, + PBUFFER_WIDTH = 0x8041, + WIDTH = 0x801D, + LEVEL = 3, + CONFIG_CAVEAT = 0x20, + RENDER_TYPE_SGIX = 0x8011, + } + + public enum GLXHyperpipeAttrib : uint + { + PIPE_RECT_LIMITS_SGIX = 0x00000002, + PIPE_RECT_SGIX = 0x00000001, + HYPERPIPE_STEREO_SGIX = 0x00000003, + HYPERPIPE_PIXEL_AVERAGE_SGIX = 0x00000004, + } + + public enum GLXStringName : uint + { + EXTENSIONS = 0x3, + VERSION = 0x2, + VENDOR = 0x1, + } + + public enum GLXEventMask : uint + { + PBUFFER_CLOBBER_MASK = 0x08000000, + BUFFER_CLOBBER_MASK_SGIX = 0x08000000, + } + + public enum GLXRenderTypeMask : uint + { + COLOR_INDEX_BIT_SGIX = 0x00000002, + RGBA_BIT = 0x00000001, + RGBA_FLOAT_BIT_ARB = 0x00000004, + RGBA_BIT_SGIX = 0x00000001, + COLOR_INDEX_BIT = 0x00000002, + } + + public enum GLXHyperpipeTypeMask : uint + { + HYPERPIPE_RENDER_PIPE_SGIX = 0x00000002, + HYPERPIPE_DISPLAY_PIPE_SGIX = 0x00000001, + } + + public enum GLXPbufferClobberMask : uint + { + ACCUM_BUFFER_BIT_SGIX = 0x00000080, + FRONT_LEFT_BUFFER_BIT = 0x00000001, + BACK_RIGHT_BUFFER_BIT = 0x00000008, + FRONT_RIGHT_BUFFER_BIT_SGIX = 0x00000002, + STENCIL_BUFFER_BIT_SGIX = 0x00000040, + SAMPLE_BUFFERS_BIT_SGIX = 0x00000100, + STENCIL_BUFFER_BIT = 0x00000040, + BACK_RIGHT_BUFFER_BIT_SGIX = 0x00000008, + BACK_LEFT_BUFFER_BIT_SGIX = 0x00000004, + AUX_BUFFERS_BIT = 0x00000010, + DEPTH_BUFFER_BIT_SGIX = 0x00000020, + ACCUM_BUFFER_BIT = 0x00000080, + AUX_BUFFERS_BIT_SGIX = 0x00000010, + DEPTH_BUFFER_BIT = 0x00000020, + FRONT_LEFT_BUFFER_BIT_SGIX = 0x00000001, + BACK_LEFT_BUFFER_BIT = 0x00000004, + FRONT_RIGHT_BUFFER_BIT = 0x00000002, + } + + public enum GLXHyperpipeMisc : uint + { + HYPERPIPE_PIPE_NAME_LENGTH_SGIX = 80, + } + + public enum GLXErrorCode : uint + { + BAD_CONTEXT = 5, + NO_EXTENSION = 3, + BAD_HYPERPIPE_SGIX = 92, + BAD_ENUM = 7, + BAD_SCREEN = 1, + BAD_VALUE = 6, + BAD_ATTRIBUTE = 2, + BAD_VISUAL = 4, + BAD_HYPERPIPE_CONFIG_SGIX = 91, + } + + public enum GLXSyncType : uint + { + SYNC_SWAP_SGIX = 0x00000001, + SYNC_FRAME_SGIX = 0x00000000, + } + + public enum GLXDrawableTypeMask : uint + { + WINDOW_BIT = 0x00000001, + PIXMAP_BIT = 0x00000002, + PBUFFER_BIT_SGIX = 0x00000004, + PBUFFER_BIT = 0x00000004, + WINDOW_BIT_SGIX = 0x00000001, + PIXMAP_BIT_SGIX = 0x00000002, + } + } - public enum GLXHyperpipeAttrib : uint - { - PIPE_RECT_LIMITS_SGIX = 0x00000002, - PIPE_RECT_SGIX = 0x00000001, - HYPERPIPE_STEREO_SGIX = 0x00000003, - HYPERPIPE_PIXEL_AVERAGE_SGIX = 0x00000004, - } - - public enum GLXStringName : uint - { - EXTENSIONS = 0x3, - VERSION = 0x2, - VENDOR = 0x1, - } - - public enum GLXEventMask : uint - { - PBUFFER_CLOBBER_MASK = 0x08000000, - BUFFER_CLOBBER_MASK_SGIX = 0x08000000, - } - - public enum GLXRenderTypeMask : uint - { - COLOR_INDEX_BIT_SGIX = 0x00000002, - RGBA_BIT = 0x00000001, - RGBA_FLOAT_BIT_ARB = 0x00000004, - RGBA_BIT_SGIX = 0x00000001, - COLOR_INDEX_BIT = 0x00000002, - } - - public enum GLXHyperpipeTypeMask : uint - { - HYPERPIPE_RENDER_PIPE_SGIX = 0x00000002, - HYPERPIPE_DISPLAY_PIPE_SGIX = 0x00000001, - } - - public enum GLXPbufferClobberMask : uint - { - ACCUM_BUFFER_BIT_SGIX = 0x00000080, - FRONT_LEFT_BUFFER_BIT = 0x00000001, - BACK_RIGHT_BUFFER_BIT = 0x00000008, - FRONT_RIGHT_BUFFER_BIT_SGIX = 0x00000002, - STENCIL_BUFFER_BIT_SGIX = 0x00000040, - SAMPLE_BUFFERS_BIT_SGIX = 0x00000100, - STENCIL_BUFFER_BIT = 0x00000040, - BACK_RIGHT_BUFFER_BIT_SGIX = 0x00000008, - BACK_LEFT_BUFFER_BIT_SGIX = 0x00000004, - AUX_BUFFERS_BIT = 0x00000010, - DEPTH_BUFFER_BIT_SGIX = 0x00000020, - ACCUM_BUFFER_BIT = 0x00000080, - AUX_BUFFERS_BIT_SGIX = 0x00000010, - DEPTH_BUFFER_BIT = 0x00000020, - FRONT_LEFT_BUFFER_BIT_SGIX = 0x00000001, - BACK_LEFT_BUFFER_BIT = 0x00000004, - FRONT_RIGHT_BUFFER_BIT = 0x00000002, - } - - public enum GLXHyperpipeMisc : uint - { - HYPERPIPE_PIPE_NAME_LENGTH_SGIX = 80, - } - - public enum GLXErrorCode : uint - { - BAD_CONTEXT = 5, - NO_EXTENSION = 3, - BAD_HYPERPIPE_SGIX = 92, - BAD_ENUM = 7, - BAD_SCREEN = 1, - BAD_VALUE = 6, - BAD_ATTRIBUTE = 2, - BAD_VISUAL = 4, - BAD_HYPERPIPE_CONFIG_SGIX = 91, - } - - public enum GLXSyncType : uint - { - SYNC_SWAP_SGIX = 0x00000001, - SYNC_FRAME_SGIX = 0x00000000, - } - - public enum GLXDrawableTypeMask : uint - { - WINDOW_BIT = 0x00000001, - PIXMAP_BIT = 0x00000002, - PBUFFER_BIT_SGIX = 0x00000004, - PBUFFER_BIT = 0x00000004, - WINDOW_BIT_SGIX = 0x00000001, - PIXMAP_BIT_SGIX = 0x00000002, - } - - } - - #endregion + #endregion #region GLX functions - [DllImport("_dll_name", EntryPoint = "glxCreateContext")] - public static extern void CreateContext(Int32 gc_id, Int32 screen, Int32 visual, Int32 share_list); + [DllImport(_dll_name, EntryPoint = "glXCreateContext")] + public static extern IntPtr CreateContext(IntPtr dpy, Api.VisualInfo vis, IntPtr shareList, bool direct); + //public static extern IntPtr CreateContext(IntPtr gc_id, Int32 screen, Int32 visual, IntPtr share_list); + + [DllImport(_dll_name, EntryPoint = "glXDestroyContext")] + public static extern void DestroyContext(IntPtr context); - [DllImport("_dll_name", EntryPoint = "glxDestroyContext")] - public static extern void DestroyContext(Int32 context); - - [DllImport("_dll_name", EntryPoint = "glxMakeCurrent")] - public static extern void MakeCurrent(Int32 drawable, Int32 context); - - [DllImport("_dll_name", EntryPoint = "glxSwapBuffers")] + [DllImport(_dll_name, EntryPoint = "glXMakeCurrent")] + public static extern void MakeCurrent(Int32 drawable, IntPtr context); + + [DllImport(_dll_name, EntryPoint = "glXSwapBuffers")] public static extern void SwapBuffers(Int32 drawable); - [DllImport("_dll_name", EntryPoint = "glxGetProcAddress")] + [DllImport(_dll_name, EntryPoint = "glXGetProcAddress")] public static extern IntPtr GetProcAddress([MarshalAs(UnmanagedType.LPTStr)] string procName); + [DllImport(_dll_name, EntryPoint = "glXChooseVisual")] + public static extern OpenTK.Platform.X.Api.VisualInfo ChooseVisual(IntPtr dpy, int screen, [MarshalAs(UnmanagedType.LPArray)]int[] attriblist); + + //public static ChooseVisual() + + //[DllImport("opengl32.dll", EntryPoint = "glCreateWindow")] //public static extern void CreateWindow(Int32 config, Int32 window, Int32 glxwindow); //[DllImport("opengl32.dll", EntryPoint = "glDestroyWindow")] diff --git a/Source/Platform/X/XApi.cs b/Source/Platform/X/XApi.cs index 725d9cdf..1b5d8510 100644 --- a/Source/Platform/X/XApi.cs +++ b/Source/Platform/X/XApi.cs @@ -7,10 +7,46 @@ using System; using System.Collections.Generic; using System.Text; +using System.Runtime.InteropServices; namespace OpenTK.Platform.X { - public class XApi + public static class Api { + private const string _dll_name = "libX11"; + + [StructLayout(LayoutKind.Sequential)] + public struct VisualInfo + { + IntPtr visual; + int visualid; + int screen; + uint depth; + int @class; + ulong red_mask; + ulong green_mask; + ulong blue_mask; + int colormap_size; + int bits_per_rgb; + } + + #region Functions + + [DllImport(_dll_name, EntryPoint = "XOpenDisplay")] + public static extern IntPtr OpenDisplay([MarshalAs(UnmanagedType.LPTStr)] string display_name); + + [DllImport(_dll_name, EntryPoint = "XCloseDisplay")] + public static extern void CloseDisplay(IntPtr display); + + [DllImport(_dll_name, EntryPoint = "XDefaultScreen")] + public static extern int DefaultScreen(IntPtr display); + + [DllImport(_dll_name, EntryPoint = "XDefaultVisual")] + public static extern IntPtr DefaultVisual(IntPtr display, int screen_number); + + [DllImport(_dll_name, EntryPoint = "XFree")] + public static extern void Free(IntPtr data); + + #endregion } } diff --git a/changelog.txt b/changelog.txt index 3eb56fa1..87b3c03e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,12 @@ OpenTK 0.3.4 -> 0.3.5 + Major update to OpenTK.OpenGL.Bind (cleaner code, new functions, comments and many new wrappers). ++ Updated the spec files for opengl 2.1. + + Added the new 64 bit types to the typemaps (gl.tm and csharp.tm) ++ The bugs in the specs are still there: + + SGIX_icc_texture is still commented out, while enums use it. + + LightProperty is still used by constants (the correct enum is LightParameter). + + I think I should contact someone at the Khronos group about these. For the time being I worked around them, by adding a special case for LightProperty in the translator, and adding the SGIX enum to the missing parameters. + + See also: http://www.haskell.org/HOpenGL/spec_bugs.html (lots of useful information on that site). + Laid the foundation for X (Linux, Unix, MacOS) support. + Added bindings to some glx functions. + Added the OpenTK.Platform.X class.