diff --git a/src/SlatedGameToolkit.Framework/Exceptions/OpenGLErrorException.cs b/src/SlatedGameToolkit.Framework/Exceptions/OpenGLErrorException.cs index ddef5d6..f44bf39 100644 --- a/src/SlatedGameToolkit.Framework/Exceptions/OpenGLErrorException.cs +++ b/src/SlatedGameToolkit.Framework/Exceptions/OpenGLErrorException.cs @@ -4,26 +4,18 @@ using SlatedGameToolkit.Framework.Graphics.Window; namespace SlatedGameToolkit.Framework.Exceptions { - public class OpenGLErrorException : OpenGLException { - public uint ErrorCode { get; private set; } - public OpenGLErrorException(uint errorCode) : base() { + public class OpenGLErrorException : Exception { + public Graphics.OpenGL.ErrorCode ErrorCode {get; private set;} + public OpenGLErrorException(Graphics.OpenGL.ErrorCode error) : base(string.Format("OpenGL error: {0}", error)) { + this.ErrorCode = error; } - public OpenGLErrorException(uint errorCode, string message) : base(message) { - + public OpenGLErrorException(Graphics.OpenGL.ErrorCode error, string message) : base(string.Format("OpenGL error: {0}. \"{1}\"", error, message)) { + this.ErrorCode = error; } - public OpenGLErrorException(uint errorCode, string message, Exception inner) : base(message, inner) { - } - - /// - /// Checks the current context for OpenGL errors that has occurred and throws an exception if there is one. - /// - public static void CheckGLErrorStatus() { - uint errorCode = WindowContextsManager.CurrentWindowContext.GetGLStatus(); - if (errorCode != (uint) GLEnum.GL_NO_ERROR) { - throw new OpenGLErrorException(errorCode, string.Format("OpenGL error ({0}): {1}", errorCode, ((GLEnum) errorCode))); - } + public OpenGLErrorException(Graphics.OpenGL.ErrorCode error, string message, Exception inner) : base(string.Format("OpenGL error: {0}. \"{1}\"", error, message), inner) { + this.ErrorCode = error; } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Exceptions/OpenGLException.cs b/src/SlatedGameToolkit.Framework/Exceptions/OpenGLException.cs deleted file mode 100644 index e7b18ab..0000000 --- a/src/SlatedGameToolkit.Framework/Exceptions/OpenGLException.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using SlatedGameToolkit.Framework.Graphics; -using SlatedGameToolkit.Framework.Graphics.Window; - -namespace SlatedGameToolkit.Framework.Exceptions -{ - public class OpenGLException : Exception { - public OpenGLException() : base() { - } - - public OpenGLException(string message) : base(message) { - - } - - public OpenGLException(string message, Exception inner) : base(message, inner) { - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/GameEngine.cs b/src/SlatedGameToolkit.Framework/GameEngine.cs index b408eeb..6d60214 100644 --- a/src/SlatedGameToolkit.Framework/GameEngine.cs +++ b/src/SlatedGameToolkit.Framework/GameEngine.cs @@ -1,21 +1,25 @@ using System; +using System.Runtime.InteropServices; using System.Threading; using SDL2; using Serilog; using Serilog.Core; using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics; +using SlatedGameToolkit.Framework.Graphics.Textures; using SlatedGameToolkit.Framework.Graphics.Window; using SlatedGameToolkit.Framework.Input; using SlatedGameToolkit.Framework.Input.Devices; using SlatedGameToolkit.Framework.StateSystem; using SlatedGameToolkit.Framework.StateSystem.States; +using SlatedGameToolkit.Framework.Utilities; namespace SlatedGameToolkit.Framework { /// /// The main engine that will host the game loop. /// public static class GameEngine { + private const int GL_MAJOR_VER = 3, GL_MINOR_VER = 3; + public static TextureData FillerTextureData {get; private set;} public static bool Debugging { get; set; } public static Logger Logger { get; private set; } private static readonly object ignitionLock = new object(); @@ -128,10 +132,10 @@ namespace SlatedGameToolkit.Framework { } break; case SDL.SDL_EventType.SDL_KEYDOWN: - Keyboard.OnKeyPressed((Key) SDL_Event.key.keysym.sym); + Keyboard.OnKeyPressed(SDL_Event.key.keysym.sym); break; case SDL.SDL_EventType.SDL_KEYUP: - Keyboard.OnKeyReleased((Key) SDL_Event.key.keysym.sym); + Keyboard.OnKeyReleased(SDL_Event.key.keysym.sym); break; case SDL.SDL_EventType.SDL_WINDOWEVENT: WindowContext handle = WindowContextsManager.ContextFromWindowID(SDL_Event.window.windowID); @@ -180,6 +184,7 @@ namespace SlatedGameToolkit.Framework { SDL.SDL_Quit(); Logger.Information("Game engine has stopped."); Logger.Dispose(); + WindowContextsManager.DisposeAllWindowContexts(); Logger = null; } } @@ -232,18 +237,45 @@ namespace SlatedGameToolkit.Framework { throw new FrameworkSDLException(); } - if (SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_MAJOR_VERSION, OpenGL.OpenGLMajorVersion) < 0) throw new FrameworkSDLException(); - if (SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_MINOR_VERSION, OpenGL.OpenGLMinorVersion) < 0) throw new FrameworkSDLException(); - if (SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_PROFILE_MASK, SDL.SDL_GLprofile.SDL_GL_CONTEXT_PROFILE_CORE) < 0) throw new FrameworkSDLException(); + if (SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_MAJOR_VERSION, GL_MAJOR_VER) < 0 || + SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_MINOR_VERSION, GL_MINOR_VER) < 0 || + SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_CONTEXT_PROFILE_MASK, SDL.SDL_GLprofile.SDL_GL_CONTEXT_PROFILE_CORE) < 0) + throw new FrameworkSDLException(string.Format("Unable to load correct OpenGL version {0}.{1}.0 Core.", GL_MINOR_VER, GL_MAJOR_VER)); + + LoadEngineAssets(); thread = new Thread(Loop); - thread.Name = "SlatedGameToolkit Engine"; + thread.Name = "SGTK-Engine"; thread.Priority = ThreadPriority.AboveNormal; thread.Start(initialState); return true; } } + private unsafe static void LoadEngineAssets() { + byte[] buffer = EmbeddedResourceUtils.ReadEmbeddedResourceData("filler.png"); + fixed (void* ptr = &buffer[0]) { + IntPtr rwOps = SDL.SDL_RWFromConstMem(new IntPtr(ptr), buffer.Length * sizeof(byte)); + IntPtr surfacePtr = SDL_image.IMG_Load_RW(rwOps, 1); + SDL.SDL_Surface surface = Marshal.PtrToStructure(surfacePtr); + + SDL.SDL_PixelFormat pixelFormat = Marshal.PtrToStructure(surface.format); + if (pixelFormat.format != SDL.SDL_PIXELFORMAT_RGBA8888) { + IntPtr convertedPtr = SDL.SDL_ConvertSurfaceFormat(surfacePtr, SDL.SDL_PIXELFORMAT_RGBA8888, 0); + if (convertedPtr == null) throw new OptionalSDLException(); + SDL.SDL_FreeSurface(surfacePtr); + surfacePtr = convertedPtr; + surface = Marshal.PtrToStructure(surfacePtr); + } + byte[] data = new byte[surface.pitch * surface.h]; + + Marshal.Copy(surface.pixels, data, 0, data.Length); + FillerTextureData = new TextureData(surface.w, surface.h, data); + + SDL.SDL_FreeSurface(surfacePtr); + } + } + public static bool IsRunning() { return !stopped; } diff --git a/src/SlatedGameToolkit.Framework/Graphics/GLEnum.cs b/src/SlatedGameToolkit.Framework/Graphics/GLEnum.cs deleted file mode 100644 index e795ad5..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/GLEnum.cs +++ /dev/null @@ -1,811 +0,0 @@ -namespace SlatedGameToolkit.Framework.Graphics -{ - public enum GLEnum: uint { - GL_DEPTH_BUFFER_BIT = 0x00000100, - GL_STENCIL_BUFFER_BIT = 0x00000400, - GL_COLOR_BUFFER_BIT = 0x00004000, - GL_FALSE = 0, - GL_TRUE = 1, - GL_POINTS = 0x0000, - GL_LINES = 0x0001, - GL_LINE_LOOP = 0x0002, - GL_LINE_STRIP = 0x0003, - GL_TRIANGLES = 0x0004, - GL_TRIANGLE_STRIP = 0x0005, - GL_TRIANGLE_FAN = 0x0006, - GL_QUADS = 0x0007, - GL_NEVER = 0x0200, - GL_LESS = 0x0201, - GL_EQUAL = 0x0202, - GL_LEQUAL = 0x0203, - GL_GREATER = 0x0204, - GL_NOTEQUAL = 0x0205, - GL_GEQUAL = 0x0206, - GL_ALWAYS = 0x0207, - GL_ZERO = 0, - GL_ONE = 1, - GL_SRC_COLOR = 0x0300, - GL_ONE_MINUS_SRC_COLOR = 0x0301, - GL_SRC_ALPHA = 0x0302, - GL_ONE_MINUS_SRC_ALPHA = 0x0303, - GL_DST_ALPHA = 0x0304, - GL_ONE_MINUS_DST_ALPHA = 0x0305, - GL_DST_COLOR = 0x0306, - GL_ONE_MINUS_DST_COLOR = 0x0307, - GL_SRC_ALPHA_SATURATE = 0x0308, - GL_NONE = 0, - GL_FRONT_LEFT = 0x0400, - GL_FRONT_RIGHT = 0x0401, - GL_BACK_LEFT = 0x0402, - GL_BACK_RIGHT = 0x0403, - GL_FRONT = 0x0404, - GL_BACK = 0x0405, - GL_LEFT = 0x0406, - GL_RIGHT = 0x0407, - GL_FRONT_AND_BACK = 0x0408, - GL_NO_ERROR = 0, - GL_INVALID_ENUM = 0x0500, - GL_INVALID_VALUE = 0x0501, - GL_INVALID_OPERATION = 0x0502, - GL_OUT_OF_MEMORY = 0x0505, - GL_CW = 0x0900, - GL_CCW = 0x0901, - GL_POINT_SIZE = 0x0B11, - GL_POINT_SIZE_RANGE = 0x0B12, - GL_POINT_SIZE_GRANULARITY = 0x0B13, - GL_LINE_SMOOTH = 0x0B20, - GL_LINE_WIDTH = 0x0B21, - GL_LINE_WIDTH_RANGE = 0x0B22, - GL_LINE_WIDTH_GRANULARITY = 0x0B23, - GL_POLYGON_MODE = 0x0B40, - GL_POLYGON_SMOOTH = 0x0B41, - GL_CULL_FACE = 0x0B44, - GL_CULL_FACE_MODE = 0x0B45, - GL_FRONT_FACE = 0x0B46, - GL_DEPTH_RANGE = 0x0B70, - GL_DEPTH_TEST = 0x0B71, - GL_DEPTH_WRITEMASK = 0x0B72, - GL_DEPTH_CLEAR_VALUE = 0x0B73, - GL_DEPTH_FUNC = 0x0B74, - GL_STENCIL_TEST = 0x0B90, - GL_STENCIL_CLEAR_VALUE = 0x0B91, - GL_STENCIL_FUNC = 0x0B92, - GL_STENCIL_VALUE_MASK = 0x0B93, - GL_STENCIL_FAIL = 0x0B94, - GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95, - GL_STENCIL_PASS_DEPTH_PASS = 0x0B96, - GL_STENCIL_REF = 0x0B97, - GL_STENCIL_WRITEMASK = 0x0B98, - GL_VIEWPORT = 0x0BA2, - GL_DITHER = 0x0BD0, - GL_BLEND_DST = 0x0BE0, - GL_BLEND_SRC = 0x0BE1, - GL_BLEND = 0x0BE2, - GL_LOGIC_OP_MODE = 0x0BF0, - GL_DRAW_BUFFER = 0x0C01, - GL_READ_BUFFER = 0x0C02, - GL_SCISSOR_BOX = 0x0C10, - GL_SCISSOR_TEST = 0x0C11, - GL_COLOR_CLEAR_VALUE = 0x0C22, - GL_COLOR_WRITEMASK = 0x0C23, - GL_DOUBLEBUFFER = 0x0C32, - GL_STEREO = 0x0C33, - GL_LINE_SMOOTH_HINT = 0x0C52, - GL_POLYGON_SMOOTH_HINT = 0x0C53, - GL_UNPACK_SWAP_BYTES = 0x0CF0, - GL_UNPACK_LSB_FIRST = 0x0CF1, - GL_UNPACK_ROW_LENGTH = 0x0CF2, - GL_UNPACK_SKIP_ROWS = 0x0CF3, - GL_UNPACK_SKIP_PIXELS = 0x0CF4, - GL_UNPACK_ALIGNMENT = 0x0CF5, - GL_PACK_SWAP_BYTES = 0x0D00, - GL_PACK_LSB_FIRST = 0x0D01, - GL_PACK_ROW_LENGTH = 0x0D02, - GL_PACK_SKIP_ROWS = 0x0D03, - GL_PACK_SKIP_PIXELS = 0x0D04, - GL_PACK_ALIGNMENT = 0x0D05, - GL_MAX_TEXTURE_SIZE = 0x0D33, - GL_MAX_VIEWPORT_DIMS = 0x0D3A, - GL_SUBPIXEL_BITS = 0x0D50, - GL_TEXTURE_1D = 0x0DE0, - GL_TEXTURE_2D = 0x0DE1, - GL_TEXTURE_WIDTH = 0x1000, - GL_TEXTURE_HEIGHT = 0x1001, - GL_TEXTURE_BORDER_COLOR = 0x1004, - GL_DONT_CARE = 0x1100, - GL_FASTEST = 0x1101, - GL_NICEST = 0x1102, - GL_BYTE = 0x1400, - GL_UNSIGNED_BYTE = 0x1401, - GL_SHORT = 0x1402, - GL_UNSIGNED_SHORT = 0x1403, - GL_INT = 0x1404, - GL_UNSIGNED_INT = 0x1405, - GL_FLOAT = 0x1406, - GL_STACK_OVERFLOW = 0x0503, - GL_STACK_UNDERFLOW = 0x0504, - GL_CLEAR = 0x1500, - GL_AND = 0x1501, - GL_AND_REVERSE = 0x1502, - GL_COPY = 0x1503, - GL_AND_INVERTED = 0x1504, - GL_NOOP = 0x1505, - GL_XOR = 0x1506, - GL_OR = 0x1507, - GL_NOR = 0x1508, - GL_EQUIV = 0x1509, - GL_INVERT = 0x150A, - GL_OR_REVERSE = 0x150B, - GL_COPY_INVERTED = 0x150C, - GL_OR_INVERTED = 0x150D, - GL_NAND = 0x150E, - GL_SET = 0x150F, - GL_TEXTURE = 0x1702, - GL_COLOR = 0x1800, - GL_DEPTH = 0x1801, - GL_STENCIL = 0x1802, - GL_STENCIL_INDEX = 0x1901, - GL_DEPTH_COMPONENT = 0x1902, - GL_RED = 0x1903, - GL_GREEN = 0x1904, - GL_BLUE = 0x1905, - GL_ALPHA = 0x1906, - GL_RGB = 0x1907, - GL_RGBA = 0x1908, - GL_POINT = 0x1B00, - GL_LINE = 0x1B01, - GL_FILL = 0x1B02, - GL_KEEP = 0x1E00, - GL_REPLACE = 0x1E01, - GL_INCR = 0x1E02, - GL_DECR = 0x1E03, - GL_VENDOR = 0x1F00, - GL_RENDERER = 0x1F01, - GL_VERSION = 0x1F02, - GL_EXTENSIONS = 0x1F03, - GL_NEAREST = 0x2600, - GL_LINEAR = 0x2601, - GL_NEAREST_MIPMAP_NEAREST = 0x2700, - GL_LINEAR_MIPMAP_NEAREST = 0x2701, - GL_NEAREST_MIPMAP_LINEAR = 0x2702, - GL_LINEAR_MIPMAP_LINEAR = 0x2703, - GL_TEXTURE_MAG_FILTER = 0x2800, - GL_TEXTURE_MIN_FILTER = 0x2801, - GL_TEXTURE_WRAP_S = 0x2802, - GL_TEXTURE_WRAP_T = 0x2803, - GL_REPEAT = 0x2901, - GL_COLOR_LOGIC_OP = 0x0BF2, - GL_POLYGON_OFFSET_UNITS = 0x2A00, - GL_POLYGON_OFFSET_POINT = 0x2A01, - GL_POLYGON_OFFSET_LINE = 0x2A02, - GL_POLYGON_OFFSET_FILL = 0x8037, - GL_POLYGON_OFFSET_FACTOR = 0x8038, - GL_TEXTURE_BINDING_1D = 0x8068, - GL_TEXTURE_BINDING_2D = 0x8069, - GL_TEXTURE_INTERNAL_FORMAT = 0x1003, - GL_TEXTURE_RED_SIZE = 0x805C, - GL_TEXTURE_GREEN_SIZE = 0x805D, - GL_TEXTURE_BLUE_SIZE = 0x805E, - GL_TEXTURE_ALPHA_SIZE = 0x805F, - GL_DOUBLE = 0x140A, - GL_PROXY_TEXTURE_1D = 0x8063, - GL_PROXY_TEXTURE_2D = 0x8064, - GL_R3_G3_B2 = 0x2A10, - GL_RGB4 = 0x804F, - GL_RGB5 = 0x8050, - GL_RGB8 = 0x8051, - GL_RGB10 = 0x8052, - GL_RGB12 = 0x8053, - GL_RGB16 = 0x8054, - GL_RGBA2 = 0x8055, - GL_RGBA4 = 0x8056, - GL_RGB5_A1 = 0x8057, - GL_RGBA8 = 0x8058, - GL_RGB10_A2 = 0x8059, - GL_RGBA12 = 0x805A, - GL_RGBA16 = 0x805B, - GL_VERTEX_ARRAY = 0x8074, - GL_UNSIGNED_BYTE_3_3_2 = 0x8032, - GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033, - GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034, - GL_UNSIGNED_INT_8_8_8_8 = 0x8035, - GL_UNSIGNED_INT_10_10_10_2 = 0x8036, - GL_TEXTURE_BINDING_3D = 0x806A, - GL_PACK_SKIP_IMAGES = 0x806B, - GL_PACK_IMAGE_HEIGHT = 0x806C, - GL_UNPACK_SKIP_IMAGES = 0x806D, - GL_UNPACK_IMAGE_HEIGHT = 0x806E, - GL_TEXTURE_3D = 0x806F, - GL_PROXY_TEXTURE_3D = 0x8070, - GL_TEXTURE_DEPTH = 0x8071, - GL_TEXTURE_WRAP_R = 0x8072, - GL_MAX_3D_TEXTURE_SIZE = 0x8073, - GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362, - GL_UNSIGNED_SHORT_5_6_5 = 0x8363, - GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364, - GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, - GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, - GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367, - GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368, - GL_BGR = 0x80E0, - GL_BGRA = 0x80E1, - GL_MAX_ELEMENTS_VERTICES = 0x80E8, - GL_MAX_ELEMENTS_INDICES = 0x80E9, - GL_CLAMP_TO_EDGE = 0x812F, - GL_TEXTURE_MIN_LOD = 0x813A, - GL_TEXTURE_MAX_LOD = 0x813B, - GL_TEXTURE_BASE_LEVEL = 0x813C, - GL_TEXTURE_MAX_LEVEL = 0x813D, - GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12, - GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13, - GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22, - GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23, - GL_ALIASED_LINE_WIDTH_RANGE = 0x846E, - GL_TEXTURE0 = 0x84C0, - GL_TEXTURE1 = 0x84C1, - GL_TEXTURE2 = 0x84C2, - GL_TEXTURE3 = 0x84C3, - GL_TEXTURE4 = 0x84C4, - GL_TEXTURE5 = 0x84C5, - GL_TEXTURE6 = 0x84C6, - GL_TEXTURE7 = 0x84C7, - GL_TEXTURE8 = 0x84C8, - GL_TEXTURE9 = 0x84C9, - GL_TEXTURE10 = 0x84CA, - GL_TEXTURE11 = 0x84CB, - GL_TEXTURE12 = 0x84CC, - GL_TEXTURE13 = 0x84CD, - GL_TEXTURE14 = 0x84CE, - GL_TEXTURE15 = 0x84CF, - GL_TEXTURE16 = 0x84D0, - GL_TEXTURE17 = 0x84D1, - GL_TEXTURE18 = 0x84D2, - GL_TEXTURE19 = 0x84D3, - GL_TEXTURE20 = 0x84D4, - GL_TEXTURE21 = 0x84D5, - GL_TEXTURE22 = 0x84D6, - GL_TEXTURE23 = 0x84D7, - GL_TEXTURE24 = 0x84D8, - GL_TEXTURE25 = 0x84D9, - GL_TEXTURE26 = 0x84DA, - GL_TEXTURE27 = 0x84DB, - GL_TEXTURE28 = 0x84DC, - GL_TEXTURE29 = 0x84DD, - GL_TEXTURE30 = 0x84DE, - GL_TEXTURE31 = 0x84DF, - GL_ACTIVE_TEXTURE = 0x84E0, - GL_MULTISAMPLE = 0x809D, - GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E, - GL_SAMPLE_ALPHA_TO_ONE = 0x809F, - GL_SAMPLE_COVERAGE = 0x80A0, - GL_SAMPLE_BUFFERS = 0x80A8, - GL_SAMPLES = 0x80A9, - GL_SAMPLE_COVERAGE_VALUE = 0x80AA, - GL_SAMPLE_COVERAGE_INVERT = 0x80AB, - GL_TEXTURE_CUBE_MAP = 0x8513, - GL_TEXTURE_BINDING_CUBE_MAP = 0x8514, - GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515, - GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516, - GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518, - GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519, - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A, - GL_PROXY_TEXTURE_CUBE_MAP = 0x851B, - GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C, - GL_COMPRESSED_RGB = 0x84ED, - GL_COMPRESSED_RGBA = 0x84EE, - GL_TEXTURE_COMPRESSION_HINT = 0x84EF, - GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0, - GL_TEXTURE_COMPRESSED = 0x86A1, - GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2, - GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3, - GL_CLAMP_TO_BORDER = 0x812D, - GL_BLEND_DST_RGB = 0x80C8, - GL_BLEND_SRC_RGB = 0x80C9, - GL_BLEND_DST_ALPHA = 0x80CA, - GL_BLEND_SRC_ALPHA = 0x80CB, - GL_POINT_FADE_THRESHOLD_SIZE = 0x8128, - GL_DEPTH_COMPONENT16 = 0x81A5, - GL_DEPTH_COMPONENT24 = 0x81A6, - GL_DEPTH_COMPONENT32 = 0x81A7, - GL_MIRRORED_REPEAT = 0x8370, - GL_MAX_TEXTURE_LOD_BIAS = 0x84FD, - GL_TEXTURE_LOD_BIAS = 0x8501, - GL_INCR_WRAP = 0x8507, - GL_DECR_WRAP = 0x8508, - GL_TEXTURE_DEPTH_SIZE = 0x884A, - GL_TEXTURE_COMPARE_MODE = 0x884C, - GL_TEXTURE_COMPARE_FUNC = 0x884D, - GL_BLEND_COLOR = 0x8005, - GL_BLEND_EQUATION = 0x8009, - GL_CONSTANT_COLOR = 0x8001, - GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, - GL_CONSTANT_ALPHA = 0x8003, - GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004, - GL_FUNC_ADD = 0x8006, - GL_FUNC_REVERSE_SUBTRACT = 0x800B, - GL_FUNC_SUBTRACT = 0x800A, - GL_MIN = 0x8007, - GL_MAX = 0x8008, - GL_BUFFER_SIZE = 0x8764, - GL_BUFFER_USAGE = 0x8765, - GL_QUERY_COUNTER_BITS = 0x8864, - GL_CURRENT_QUERY = 0x8865, - GL_QUERY_RESULT = 0x8866, - GL_QUERY_RESULT_AVAILABLE = 0x8867, - GL_ARRAY_BUFFER = 0x8892, - GL_ELEMENT_ARRAY_BUFFER = 0x8893, - GL_ARRAY_BUFFER_BINDING = 0x8894, - GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895, - GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F, - GL_READ_ONLY = 0x88B8, - GL_WRITE_ONLY = 0x88B9, - GL_READ_WRITE = 0x88BA, - GL_BUFFER_ACCESS = 0x88BB, - GL_BUFFER_MAPPED = 0x88BC, - GL_BUFFER_MAP_POINTER = 0x88BD, - GL_STREAM_DRAW = 0x88E0, - GL_STREAM_READ = 0x88E1, - GL_STREAM_COPY = 0x88E2, - GL_STATIC_DRAW = 0x88E4, - GL_STATIC_READ = 0x88E5, - GL_STATIC_COPY = 0x88E6, - GL_DYNAMIC_DRAW = 0x88E8, - GL_DYNAMIC_READ = 0x88E9, - GL_DYNAMIC_COPY = 0x88EA, - GL_SAMPLES_PASSED = 0x8914, - GL_SRC1_ALPHA = 0x8589, - GL_BLEND_EQUATION_RGB = 0x8009, - GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622, - GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623, - GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624, - GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625, - GL_CURRENT_VERTEX_ATTRIB = 0x8626, - GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642, - GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645, - GL_STENCIL_BACK_FUNC = 0x8800, - GL_STENCIL_BACK_FAIL = 0x8801, - GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802, - GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803, - GL_MAX_DRAW_BUFFERS = 0x8824, - GL_DRAW_BUFFER0 = 0x8825, - GL_DRAW_BUFFER1 = 0x8826, - GL_DRAW_BUFFER2 = 0x8827, - GL_DRAW_BUFFER3 = 0x8828, - GL_DRAW_BUFFER4 = 0x8829, - GL_DRAW_BUFFER5 = 0x882A, - GL_DRAW_BUFFER6 = 0x882B, - GL_DRAW_BUFFER7 = 0x882C, - GL_DRAW_BUFFER8 = 0x882D, - GL_DRAW_BUFFER9 = 0x882E, - GL_DRAW_BUFFER10 = 0x882F, - GL_DRAW_BUFFER11 = 0x8830, - GL_DRAW_BUFFER12 = 0x8831, - GL_DRAW_BUFFER13 = 0x8832, - GL_DRAW_BUFFER14 = 0x8833, - GL_DRAW_BUFFER15 = 0x8834, - GL_BLEND_EQUATION_ALPHA = 0x883D, - GL_MAX_VERTEX_ATTRIBS = 0x8869, - GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A, - GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872, - GL_FRAGMENT_SHADER = 0x8B30, - GL_VERTEX_SHADER = 0x8B31, - GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49, - GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A, - GL_MAX_VARYING_FLOATS = 0x8B4B, - GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C, - GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D, - GL_SHADER_TYPE = 0x8B4F, - GL_FLOAT_VEC2 = 0x8B50, - GL_FLOAT_VEC3 = 0x8B51, - GL_FLOAT_VEC4 = 0x8B52, - GL_INT_VEC2 = 0x8B53, - GL_INT_VEC3 = 0x8B54, - GL_INT_VEC4 = 0x8B55, - GL_BOOL = 0x8B56, - GL_BOOL_VEC2 = 0x8B57, - GL_BOOL_VEC3 = 0x8B58, - GL_BOOL_VEC4 = 0x8B59, - GL_FLOAT_MAT2 = 0x8B5A, - GL_FLOAT_MAT3 = 0x8B5B, - GL_FLOAT_MAT4 = 0x8B5C, - GL_SAMPLER_1D = 0x8B5D, - GL_SAMPLER_2D = 0x8B5E, - GL_SAMPLER_3D = 0x8B5F, - GL_SAMPLER_CUBE = 0x8B60, - GL_SAMPLER_1D_SHADOW = 0x8B61, - GL_SAMPLER_2D_SHADOW = 0x8B62, - GL_DELETE_STATUS = 0x8B80, - GL_COMPILE_STATUS = 0x8B81, - GL_LINK_STATUS = 0x8B82, - GL_VALIDATE_STATUS = 0x8B83, - GL_INFO_LOG_LENGTH = 0x8B84, - GL_ATTACHED_SHADERS = 0x8B85, - GL_ACTIVE_UNIFORMS = 0x8B86, - GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87, - GL_SHADER_SOURCE_LENGTH = 0x8B88, - GL_ACTIVE_ATTRIBUTES = 0x8B89, - GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A, - GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B, - GL_SHADING_LANGUAGE_VERSION = 0x8B8C, - GL_CURRENT_PROGRAM = 0x8B8D, - GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0, - GL_LOWER_LEFT = 0x8CA1, - GL_UPPER_LEFT = 0x8CA2, - GL_STENCIL_BACK_REF = 0x8CA3, - GL_STENCIL_BACK_VALUE_MASK = 0x8CA4, - GL_STENCIL_BACK_WRITEMASK = 0x8CA5, - GL_PIXEL_PACK_BUFFER = 0x88EB, - GL_PIXEL_UNPACK_BUFFER = 0x88EC, - GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED, - GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF, - GL_FLOAT_MAT2x3 = 0x8B65, - GL_FLOAT_MAT2x4 = 0x8B66, - GL_FLOAT_MAT3x2 = 0x8B67, - GL_FLOAT_MAT3x4 = 0x8B68, - GL_FLOAT_MAT4x2 = 0x8B69, - GL_FLOAT_MAT4x3 = 0x8B6A, - GL_SRGB = 0x8C40, - GL_SRGB8 = 0x8C41, - GL_SRGB_ALPHA = 0x8C42, - GL_SRGB8_ALPHA8 = 0x8C43, - GL_COMPRESSED_SRGB = 0x8C48, - GL_COMPRESSED_SRGB_ALPHA = 0x8C49, - GL_COMPARE_REF_TO_TEXTURE = 0x884E, - GL_CLIP_DISTANCE0 = 0x3000, - GL_CLIP_DISTANCE1 = 0x3001, - GL_CLIP_DISTANCE2 = 0x3002, - GL_CLIP_DISTANCE3 = 0x3003, - GL_CLIP_DISTANCE4 = 0x3004, - GL_CLIP_DISTANCE5 = 0x3005, - GL_CLIP_DISTANCE6 = 0x3006, - GL_CLIP_DISTANCE7 = 0x3007, - GL_MAX_CLIP_DISTANCES = 0x0D32, - GL_MAJOR_VERSION = 0x821B, - GL_MINOR_VERSION = 0x821C, - GL_NUM_EXTENSIONS = 0x821D, - GL_CONTEXT_FLAGS = 0x821E, - GL_COMPRESSED_RED = 0x8225, - GL_COMPRESSED_RG = 0x8226, - GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001, - GL_RGBA32F = 0x8814, - GL_RGB32F = 0x8815, - GL_RGBA16F = 0x881A, - GL_RGB16F = 0x881B, - GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD, - GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF, - GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904, - GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905, - GL_CLAMP_READ_COLOR = 0x891C, - GL_FIXED_ONLY = 0x891D, - GL_MAX_VARYING_COMPONENTS = 0x8B4B, - GL_TEXTURE_1D_ARRAY = 0x8C18, - GL_PROXY_TEXTURE_1D_ARRAY = 0x8C19, - GL_TEXTURE_2D_ARRAY = 0x8C1A, - GL_PROXY_TEXTURE_2D_ARRAY = 0x8C1B, - GL_TEXTURE_BINDING_1D_ARRAY = 0x8C1C, - GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D, - GL_R11F_G11F_B10F = 0x8C3A, - GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B, - GL_RGB9_E5 = 0x8C3D, - GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E, - GL_TEXTURE_SHARED_SIZE = 0x8C3F, - GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76, - GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F, - GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80, - GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83, - GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84, - GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85, - GL_PRIMITIVES_GENERATED = 0x8C87, - GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88, - GL_RASTERIZER_DISCARD = 0x8C89, - GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A, - GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B, - GL_INTERLEAVED_ATTRIBS = 0x8C8C, - GL_SEPARATE_ATTRIBS = 0x8C8D, - GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E, - GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F, - GL_RGBA32UI = 0x8D70, - GL_RGB32UI = 0x8D71, - GL_RGBA16UI = 0x8D76, - GL_RGB16UI = 0x8D77, - GL_RGBA8UI = 0x8D7C, - GL_RGB8UI = 0x8D7D, - GL_RGBA32I = 0x8D82, - GL_RGB32I = 0x8D83, - GL_RGBA16I = 0x8D88, - GL_RGB16I = 0x8D89, - GL_RGBA8I = 0x8D8E, - GL_RGB8I = 0x8D8F, - GL_RED_INTEGER = 0x8D94, - GL_GREEN_INTEGER = 0x8D95, - GL_BLUE_INTEGER = 0x8D96, - GL_RGB_INTEGER = 0x8D98, - GL_RGBA_INTEGER = 0x8D99, - GL_BGR_INTEGER = 0x8D9A, - GL_BGRA_INTEGER = 0x8D9B, - GL_SAMPLER_1D_ARRAY = 0x8DC0, - GL_SAMPLER_2D_ARRAY = 0x8DC1, - GL_SAMPLER_1D_ARRAY_SHADOW = 0x8DC3, - GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4, - GL_SAMPLER_CUBE_SHADOW = 0x8DC5, - GL_UNSIGNED_INT_VEC2 = 0x8DC6, - GL_UNSIGNED_INT_VEC3 = 0x8DC7, - GL_UNSIGNED_INT_VEC4 = 0x8DC8, - GL_INT_SAMPLER_1D = 0x8DC9, - GL_INT_SAMPLER_2D = 0x8DCA, - GL_INT_SAMPLER_3D = 0x8DCB, - GL_INT_SAMPLER_CUBE = 0x8DCC, - GL_INT_SAMPLER_1D_ARRAY = 0x8DCE, - GL_INT_SAMPLER_2D_ARRAY = 0x8DCF, - GL_UNSIGNED_INT_SAMPLER_1D = 0x8DD1, - GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2, - GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3, - GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4, - GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6, - GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7, - GL_QUERY_WAIT = 0x8E13, - GL_QUERY_NO_WAIT = 0x8E14, - GL_QUERY_BY_REGION_WAIT = 0x8E15, - GL_QUERY_BY_REGION_NO_WAIT = 0x8E16, - GL_BUFFER_ACCESS_FLAGS = 0x911F, - GL_BUFFER_MAP_LENGTH = 0x9120, - GL_BUFFER_MAP_OFFSET = 0x9121, - GL_DEPTH_COMPONENT32F = 0x8CAC, - GL_DEPTH32F_STENCIL8 = 0x8CAD, - GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD, - GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506, - GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210, - GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211, - GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212, - GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213, - GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214, - GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215, - GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216, - GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217, - GL_FRAMEBUFFER_DEFAULT = 0x8218, - GL_FRAMEBUFFER_UNDEFINED = 0x8219, - GL_DEPTH_STENCIL_ATTACHMENT = 0x821A, - GL_MAX_RENDERBUFFER_SIZE = 0x84E8, - GL_DEPTH_STENCIL = 0x84F9, - GL_UNSIGNED_INT_24_8 = 0x84FA, - GL_DEPTH24_STENCIL8 = 0x88F0, - GL_TEXTURE_STENCIL_SIZE = 0x88F1, - GL_TEXTURE_RED_TYPE = 0x8C10, - GL_TEXTURE_GREEN_TYPE = 0x8C11, - GL_TEXTURE_BLUE_TYPE = 0x8C12, - GL_TEXTURE_ALPHA_TYPE = 0x8C13, - GL_TEXTURE_DEPTH_TYPE = 0x8C16, - GL_UNSIGNED_NORMALIZED = 0x8C17, - GL_FRAMEBUFFER_BINDING = 0x8CA6, - GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6, - GL_RENDERBUFFER_BINDING = 0x8CA7, - GL_READ_FRAMEBUFFER = 0x8CA8, - GL_DRAW_FRAMEBUFFER = 0x8CA9, - GL_READ_FRAMEBUFFER_BINDING = 0x8CAA, - GL_RENDERBUFFER_SAMPLES = 0x8CAB, - GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0, - GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1, - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2, - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3, - GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4, - GL_FRAMEBUFFER_COMPLETE = 0x8CD5, - GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6, - GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7, - GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB, - GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC, - GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD, - GL_MAX_COLOR_ATTACHMENTS = 0x8CDF, - GL_COLOR_ATTACHMENT0 = 0x8CE0, - GL_COLOR_ATTACHMENT1 = 0x8CE1, - GL_COLOR_ATTACHMENT2 = 0x8CE2, - GL_COLOR_ATTACHMENT3 = 0x8CE3, - GL_COLOR_ATTACHMENT4 = 0x8CE4, - GL_COLOR_ATTACHMENT5 = 0x8CE5, - GL_COLOR_ATTACHMENT6 = 0x8CE6, - GL_COLOR_ATTACHMENT7 = 0x8CE7, - GL_COLOR_ATTACHMENT8 = 0x8CE8, - GL_COLOR_ATTACHMENT9 = 0x8CE9, - GL_COLOR_ATTACHMENT10 = 0x8CEA, - GL_COLOR_ATTACHMENT11 = 0x8CEB, - GL_COLOR_ATTACHMENT12 = 0x8CEC, - GL_COLOR_ATTACHMENT13 = 0x8CED, - GL_COLOR_ATTACHMENT14 = 0x8CEE, - GL_COLOR_ATTACHMENT15 = 0x8CEF, - GL_COLOR_ATTACHMENT16 = 0x8CF0, - GL_COLOR_ATTACHMENT17 = 0x8CF1, - GL_COLOR_ATTACHMENT18 = 0x8CF2, - GL_COLOR_ATTACHMENT19 = 0x8CF3, - GL_COLOR_ATTACHMENT20 = 0x8CF4, - GL_COLOR_ATTACHMENT21 = 0x8CF5, - GL_COLOR_ATTACHMENT22 = 0x8CF6, - GL_COLOR_ATTACHMENT23 = 0x8CF7, - GL_COLOR_ATTACHMENT24 = 0x8CF8, - GL_COLOR_ATTACHMENT25 = 0x8CF9, - GL_COLOR_ATTACHMENT26 = 0x8CFA, - GL_COLOR_ATTACHMENT27 = 0x8CFB, - GL_COLOR_ATTACHMENT28 = 0x8CFC, - GL_COLOR_ATTACHMENT29 = 0x8CFD, - GL_COLOR_ATTACHMENT30 = 0x8CFE, - GL_COLOR_ATTACHMENT31 = 0x8CFF, - GL_DEPTH_ATTACHMENT = 0x8D00, - GL_STENCIL_ATTACHMENT = 0x8D20, - GL_FRAMEBUFFER = 0x8D40, - GL_RENDERBUFFER = 0x8D41, - GL_RENDERBUFFER_WIDTH = 0x8D42, - GL_RENDERBUFFER_HEIGHT = 0x8D43, - GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44, - GL_STENCIL_INDEX1 = 0x8D46, - GL_STENCIL_INDEX4 = 0x8D47, - GL_STENCIL_INDEX8 = 0x8D48, - GL_STENCIL_INDEX16 = 0x8D49, - GL_RENDERBUFFER_RED_SIZE = 0x8D50, - GL_RENDERBUFFER_GREEN_SIZE = 0x8D51, - GL_RENDERBUFFER_BLUE_SIZE = 0x8D52, - GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53, - GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54, - GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55, - GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56, - GL_MAX_SAMPLES = 0x8D57, - GL_FRAMEBUFFER_SRGB = 0x8DB9, - GL_HALF_FLOAT = 0x140B, - GL_MAP_READ_BIT = 0x0001, - GL_MAP_WRITE_BIT = 0x0002, - GL_MAP_INVALIDATE_RANGE_BIT = 0x0004, - GL_MAP_INVALIDATE_BUFFER_BIT = 0x0008, - GL_MAP_FLUSH_EXPLICIT_BIT = 0x0010, - GL_MAP_UNSYNCHRONIZED_BIT = 0x0020, - GL_COMPRESSED_RED_RGTC1 = 0x8DBB, - GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, - GL_COMPRESSED_RG_RGTC2 = 0x8DBD, - GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE, - GL_RG = 0x8227, - GL_RG_INTEGER = 0x8228, - GL_R8 = 0x8229, - GL_R16 = 0x822A, - GL_RG8 = 0x822B, - GL_RG16 = 0x822C, - GL_R16F = 0x822D, - GL_R32F = 0x822E, - GL_RG16F = 0x822F, - GL_RG32F = 0x8230, - GL_R8I = 0x8231, - GL_R8UI = 0x8232, - GL_R16I = 0x8233, - GL_R16UI = 0x8234, - GL_R32I = 0x8235, - GL_R32UI = 0x8236, - GL_RG8I = 0x8237, - GL_RG8UI = 0x8238, - GL_RG16I = 0x8239, - GL_RG16UI = 0x823A, - GL_RG32I = 0x823B, - GL_RG32UI = 0x823C, - GL_VERTEX_ARRAY_BINDING = 0x85B5, - GL_SAMPLER_2D_RECT = 0x8B63, - GL_SAMPLER_2D_RECT_SHADOW = 0x8B64, - GL_SAMPLER_BUFFER = 0x8DC2, - GL_INT_SAMPLER_2D_RECT = 0x8DCD, - GL_INT_SAMPLER_BUFFER = 0x8DD0, - GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5, - GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8, - GL_TEXTURE_BUFFER = 0x8C2A, - GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B, - GL_TEXTURE_BINDING_BUFFER = 0x8C2C, - GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D, - GL_TEXTURE_RECTANGLE = 0x84F5, - GL_TEXTURE_BINDING_RECTANGLE = 0x84F6, - GL_PROXY_TEXTURE_RECTANGLE = 0x84F7, - GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8, - GL_R8_SNORM = 0x8F94, - GL_RG8_SNORM = 0x8F95, - GL_RGB8_SNORM = 0x8F96, - GL_RGBA8_SNORM = 0x8F97, - GL_R16_SNORM = 0x8F98, - GL_RG16_SNORM = 0x8F99, - GL_RGB16_SNORM = 0x8F9A, - GL_RGBA16_SNORM = 0x8F9B, - GL_SIGNED_NORMALIZED = 0x8F9C, - GL_PRIMITIVE_RESTART = 0x8F9D, - GL_PRIMITIVE_RESTART_INDEX = 0x8F9E, - GL_COPY_READ_BUFFER = 0x8F36, - GL_COPY_WRITE_BUFFER = 0x8F37, - GL_UNIFORM_BUFFER = 0x8A11, - GL_UNIFORM_BUFFER_BINDING = 0x8A28, - GL_UNIFORM_BUFFER_START = 0x8A29, - GL_UNIFORM_BUFFER_SIZE = 0x8A2A, - GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B, - GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C, - GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D, - GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E, - GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F, - GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30, - GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31, - GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32, - GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33, - GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34, - GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35, - GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36, - GL_UNIFORM_TYPE = 0x8A37, - GL_UNIFORM_SIZE = 0x8A38, - GL_UNIFORM_NAME_LENGTH = 0x8A39, - GL_UNIFORM_BLOCK_INDEX = 0x8A3A, - GL_UNIFORM_OFFSET = 0x8A3B, - GL_UNIFORM_ARRAY_STRIDE = 0x8A3C, - GL_UNIFORM_MATRIX_STRIDE = 0x8A3D, - GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E, - GL_UNIFORM_BLOCK_BINDING = 0x8A3F, - GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40, - GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41, - GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42, - GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43, - GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44, - GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45, - GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46, - GL_INVALID_INDEX = 0xFFFFFFFFu, - GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001, - GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002, - GL_LINES_ADJACENCY = 0x000A, - GL_LINE_STRIP_ADJACENCY = 0x000B, - GL_TRIANGLES_ADJACENCY = 0x000C, - GL_TRIANGLE_STRIP_ADJACENCY = 0x000D, - GL_PROGRAM_POINT_SIZE = 0x8642, - GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29, - GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7, - GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8, - GL_GEOMETRY_SHADER = 0x8DD9, - GL_GEOMETRY_VERTICES_OUT = 0x8916, - GL_GEOMETRY_INPUT_TYPE = 0x8917, - GL_GEOMETRY_OUTPUT_TYPE = 0x8918, - GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF, - GL_MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0, - GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1, - GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122, - GL_MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123, - GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124, - GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125, - GL_CONTEXT_PROFILE_MASK = 0x9126, - GL_DEPTH_CLAMP = 0x864F, - GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C, - GL_FIRST_VERTEX_CONVENTION = 0x8E4D, - GL_LAST_VERTEX_CONVENTION = 0x8E4E, - GL_PROVOKING_VERTEX = 0x8E4F, - GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F, - GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111, - GL_OBJECT_TYPE = 0x9112, - GL_SYNC_CONDITION = 0x9113, - GL_SYNC_STATUS = 0x9114, - GL_SYNC_FLAGS = 0x9115, - GL_SYNC_FENCE = 0x9116, - GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117, - GL_UNSIGNALED = 0x9118, - GL_SIGNALED = 0x9119, - GL_ALREADY_SIGNALED = 0x911A, - GL_TIMEOUT_EXPIRED = 0x911B, - GL_CONDITION_SATISFIED = 0x911C, - GL_WAIT_FAILED = 0x911D, - // GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFull, - GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001, - GL_SAMPLE_POSITION = 0x8E50, - GL_SAMPLE_MASK = 0x8E51, - GL_SAMPLE_MASK_VALUE = 0x8E52, - GL_MAX_SAMPLE_MASK_WORDS = 0x8E59, - GL_TEXTURE_2D_MULTISAMPLE = 0x9100, - GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101, - GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102, - GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103, - GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104, - GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105, - GL_TEXTURE_SAMPLES = 0x9106, - GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107, - GL_SAMPLER_2D_MULTISAMPLE = 0x9108, - GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109, - GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A, - GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B, - GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C, - GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D, - GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E, - GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F, - GL_MAX_INTEGER_SAMPLES = 0x9110, - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Meshes/IMeshable.cs b/src/SlatedGameToolkit.Framework/Graphics/Meshes/IMeshable.cs index 618a91e..2e36811 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Meshes/IMeshable.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Meshes/IMeshable.cs @@ -1,6 +1,8 @@ using System; +using System.Drawing; using System.Numerics; +using SlatedGameToolkit.Framework.Graphics.Textures; namespace SlatedGameToolkit.Framework.Graphics.Meshes { @@ -18,5 +20,17 @@ namespace SlatedGameToolkit.Framework.Graphics.Meshes /// /// unsigned integers that are the indices of the vertices to use. uint[] Elements { get; } + + /// + /// The texture for this mesh. + /// + /// Texture for this mesh. + Texture Texture { get; } + + /// + /// The blended color of this mesh. + /// + /// A color for this mesh. + Color Color { get; } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Meshes/RectangleMesh.cs b/src/SlatedGameToolkit.Framework/Graphics/Meshes/RectangleMesh.cs index 831d871..23385f9 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Meshes/RectangleMesh.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Meshes/RectangleMesh.cs @@ -1,17 +1,18 @@ using System; using System.Drawing; using System.Numerics; +using SlatedGameToolkit.Framework.Graphics.Textures; namespace SlatedGameToolkit.Framework.Graphics.Meshes { - public abstract class RectangleMesh : IMeshable + public class RectangleMesh : IMeshable { - private Matrix4x4 matRot; + private Matrix4x4 matRot = Matrix4x4.Identity; private bool changed; private Vector3 rotation; private Vector2 origin, dimensions; - protected readonly Vector2[] textureCoords = new Vector2[4]; - private ValueTuple[] vertices = new ValueTuple[4]; + public readonly Vector2[] textureCoords = new Vector2[4]; + public ValueTuple[] vertices = new ValueTuple[4]; private uint[] indices = new uint[] {0, 1, 3, 1, 2, 3}; public ValueTuple[] Vertices @@ -28,10 +29,10 @@ namespace SlatedGameToolkit.Framework.Graphics.Meshes return origin.X; } - protected set + set { changed = true; - origin.X = X; + origin.X = value; } } @@ -41,7 +42,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Meshes return origin.Y; } - protected set + set { changed = true; origin.Y = value; @@ -55,7 +56,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Meshes return dimensions.X; } - protected set + set { changed = true; dimensions.X = value; @@ -69,7 +70,8 @@ namespace SlatedGameToolkit.Framework.Graphics.Meshes return dimensions.Y; } - protected set + + set { changed = true; dimensions.Y = value; @@ -92,6 +94,11 @@ namespace SlatedGameToolkit.Framework.Graphics.Meshes matRot = Matrix4x4.CreateFromYawPitchRoll(value.X, value.Y, value.Z); } } + + public Texture Texture { get; set; } + + public Color Color { get; set; } + private void CalculateVertices() { if (!changed) return; Vector3[] baseVerts = new Vector3[4]; diff --git a/src/SlatedGameToolkit.Framework/Graphics/OpenGL.cs b/src/SlatedGameToolkit.Framework/Graphics/OpenGL.cs deleted file mode 100644 index ba98028..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/OpenGL.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using SDL2; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics.Programs; -using SlatedGameToolkit.Framework.Graphics.Shaders; - -namespace SlatedGameToolkit.Framework.Graphics -{ - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLClearColour(float r, float g, float b); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLClear(GLEnum flags); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLViewport(int x, int y, int width, int height); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate UIntPtr GLCreateShader(GLEnum type); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate UIntPtr GLShaderSource(UIntPtr shaderHandle, uint count, string[] program, int[] length); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLCompileShader(UIntPtr shaderHandle); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLGetShaderInfoLog(UIntPtr shader, uint maxLength, out uint writtenLength, byte[] output); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate UIntPtr GLCreateProgram(); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate UIntPtr GLDeleteProgram(UIntPtr program); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLAttachShader(UIntPtr program, UIntPtr shader); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDetachShader(UIntPtr program, UIntPtr shader); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDeleteShader(UIntPtr shader); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLBindAttribLocation(UIntPtr program, uint index, string name); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLGetProgramInfoLog(UIntPtr program, uint maxLength, out uint writtenLength, byte[] output); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLLinkProgram(UIntPtr program); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLProgramParameter(UIntPtr program, GLEnum parameterName, int value); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLUseProgram(UIntPtr program); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLGenProgramPipelines(uint size, UIntPtr[] pipelines); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDeleteProgramPipelines(uint size, UIntPtr[] pipelines); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLBindProgramPipeline(UIntPtr pipeline); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLUseProgramStages(UIntPtr pipeline, GLEnum bitField, UIntPtr program); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate uint GLGetError(); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate int GLGetAttribLocation(UIntPtr program, string attribName); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLBindBuffer(GLEnum target, UIntPtr buffer); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLGenBuffers(uint size, UIntPtr[] buffers); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public unsafe delegate void GLBufferData(GLEnum target, uint size, Array data, GLEnum usage); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDeleteBuffers(uint size, UIntPtr[] buffers); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLVertexAttribPointer(uint index, int size, GLEnum type, bool normalized, uint stride, uint offset); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLGenVertexArrays(uint amount, UIntPtr[] arrays); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDeleteVertexArrays(uint amount, UIntPtr[] arrays); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLBindVertexArray(UIntPtr array); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLEnableVertexAttribArray(uint attribIndex); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDisableVertexAttribArray(uint attribIndex); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDrawArrays(GLEnum mode, int first, uint count); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDrawElements(GLEnum mode, uint count, int offset); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLMultiDrawArrays(GLEnum mode, int[] first, uint[] count, uint primout); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLMultiDrawElements(GLEnum mode, uint[] count, GLEnum type, uint[] indiceOffsets, int length); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLGenTextures(uint n, UIntPtr[] textureHandles); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLBindTexture(GLEnum target, UIntPtr texture); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLDeleteTextures(uint n, UIntPtr[] textureHandles); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLTexParameteri(GLEnum target, GLEnum pname, int value); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLTexParameterf(GLEnum target, GLEnum pname, float value); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLTexParameteriv(GLEnum target, GLEnum pname, int[] values); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLTexParameterfv(GLEnum target, GLEnum pname, float[] values); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLTexImage2D(GLEnum target, int level, int publicFormat, uint width, uint height, int border, GLEnum format, GLEnum type, byte[] data); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLGenerateMipmap(GLEnum target); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate int GLGetUniformLocation(UIntPtr program, string name); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GLUniformMatrix4fv(int index, uint count, bool transpose, float[] matrix); - - public static class OpenGL { - public const int OpenGLMajorVersion = 3; - public const int OpenGLMinorVersion = 3; - /// - /// Attempts to retrieve and instantiate an OpenGL function as a C# delegate. - /// Make sure the delegates signature is correct as failing to do so will potentially - /// lead to a CLR error on usage. - /// - /// Uses SDL2 as the function address retriever. - /// - /// The process name, case sensitive, exactly as OpenGL defines it. - /// The delegate type to cast to. - /// The delegate associated with the retrieved path. - public static T RetrieveGLDelegate(string functionName) where T : Delegate { - GameEngine.Logger.Debug(String.Format("Retrieving function with name: {0}", functionName)); - IntPtr functionAddress = SDL.SDL_GL_GetProcAddress(functionName); - if (functionAddress.Equals(IntPtr.Zero)) throw new FrameworkSDLException(); - return Marshal.GetDelegateForFunctionPointer(functionAddress); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/OpenGL/GLContext.cs b/src/SlatedGameToolkit.Framework/Graphics/OpenGL/GLContext.cs new file mode 100644 index 0000000..588b8f8 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Graphics/OpenGL/GLContext.cs @@ -0,0 +1,3545 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.InteropServices; +using System.Security; +using SDL2; +using SlatedGameToolkit.Framework.Exceptions; + +namespace SlatedGameToolkit.Framework.Graphics.OpenGL +{ + [SuppressUnmanagedCodeSecurity] + [SuppressMessage("ReSharper", "StringLiteralTypo")] + [SuppressMessage("ReSharper", "IdentifierTypo")] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public class GLContext : IDisposable + { + public IntPtr Handle { get; private set; } + private bool disposed; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCULLFACEPROC(CullFaceMode mode); + private PFNGLCULLFACEPROC glCullFace; + + public void CullFace(CullFaceMode mode) + { + glCullFace.Invoke(mode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFRONTFACEPROC(FrontFaceDirection mode); + private PFNGLFRONTFACEPROC glFrontFace; + + public void FrontFace(FrontFaceDirection mode) + { + glFrontFace.Invoke(mode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLHINTPROC(HintTarget target, HintMode mode); + private PFNGLHINTPROC glHint; + + public void Hint(HintTarget target, HintMode mode) + { + glHint.Invoke(target, mode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLLINEWIDTHPROC(float width); + private PFNGLLINEWIDTHPROC glLineWidth; + + public void LineWidth(float width) + { + glLineWidth.Invoke(width); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPOINTSIZEPROC(float size); + private PFNGLPOINTSIZEPROC glPointSize; + + public void PointSize(float size) + { + glPointSize.Invoke(size); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPOLYGONMODEPROC(MaterialFace face, PolygonMode mode); + private PFNGLPOLYGONMODEPROC glPolygonMode; + + public void PolygonMode(MaterialFace face, PolygonMode mode) + { + glPolygonMode.Invoke(face, mode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSCISSORPROC(int x, int y, int width, int height); + private PFNGLSCISSORPROC glScissor; + + public void Scissor(int x, int y, int width, int height) + { + glScissor.Invoke(x, y, width, height); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXPARAMETERFPROC(TextureTarget target, TextureParameterName pname, float param); + private PFNGLTEXPARAMETERFPROC glTexParameterf; + + public void TexParameterf(TextureTarget target, TextureParameterName pname, float param) + { + glTexParameterf.Invoke(target, pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXPARAMETERFVPROC(TextureTarget target, TextureParameterName pname, float[] parameters); + private PFNGLTEXPARAMETERFVPROC glTexParameterfv; + + public void TexParameterfv(TextureTarget target, TextureParameterName pname, float[] parameters) + { + glTexParameterfv.Invoke(target, pname, parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXPARAMETERIPROC(TextureTarget target, TextureParameterName pname, int param); + private PFNGLTEXPARAMETERIPROC glTexParameteri; + + public void TexParameteri(TextureTarget target, TextureParameterName pname, int param) + { + glTexParameteri.Invoke(target, pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXPARAMETERIVPROC(TextureTarget target, TextureParameterName pname, int[] parameters); + private PFNGLTEXPARAMETERIVPROC glTexParameteriv; + + public void TexParameteriv(TextureTarget target, TextureParameterName pname, int[] parameters) + { + glTexParameteriv.Invoke(target, pname, parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXIMAGE1DPROC(TextureTarget target, int level, int internalformat, int width, int border, PixelFormat format, PixelType type, IntPtr pixels); + private PFNGLTEXIMAGE1DPROC glTexImage1D; + + public void TexImage1D(TextureTarget target, int level, int internalformat, int width, int border, PixelFormat format, PixelType type, IntPtr pixels) + { + glTexImage1D.Invoke(target, level, internalformat, width, border, format, type, pixels); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXIMAGE2DPROC(TextureTarget target, int level, InternalFormat internalformat, uint width, uint height, int border, PixelFormat format, PixelType type, IntPtr pixels); + private PFNGLTEXIMAGE2DPROC glTexImage2D; + + public void TexImage2D(TextureTarget target, int level, InternalFormat internalformat, uint width, uint height, int border, PixelFormat format, PixelType type, IntPtr pixels) + { + glTexImage2D.Invoke(target, level, internalformat, width, height, border, format, type, pixels); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWBUFFERPROC(DrawBufferMode buf); + private PFNGLDRAWBUFFERPROC glDrawBuffer; + + public void DrawBuffer(DrawBufferMode buf) + { + glDrawBuffer.Invoke(buf); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLEARPROC(ClearBufferMask mask); + private PFNGLCLEARPROC glClear; + + public void Clear(ClearBufferMask mask) + { + glClear.Invoke(mask); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLEARCOLORPROC(float red, float green, float blue, float alpha); + private PFNGLCLEARCOLORPROC glClearColor; + + public void ClearColor(float red, float green, float blue, float alpha) + { + glClearColor.Invoke(red, green, blue, alpha); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLEARSTENCILPROC(int s); + private PFNGLCLEARSTENCILPROC glClearStencil; + + public void ClearStencil(int s) + { + glClearStencil.Invoke(s); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLEARDEPTHPROC(double depth); + private PFNGLCLEARDEPTHPROC glClearDepth; + + public void ClearDepth(double depth) + { + glClearDepth.Invoke(depth); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSTENCILMASKPROC(uint mask); + private PFNGLSTENCILMASKPROC glStencilMask; + + public void StencilMask(uint mask) + { + glStencilMask.Invoke(mask); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOLORMASKPROC(bool red, bool green, bool blue, bool alpha); + private PFNGLCOLORMASKPROC glColorMask; + + public void ColorMask(bool red, bool green, bool blue, bool alpha) + { + glColorMask.Invoke(red, green, blue, alpha); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDEPTHMASKPROC(bool flag); + private PFNGLDEPTHMASKPROC glDepthMask; + + public void DepthMask(bool flag) + { + glDepthMask.Invoke(flag); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDISABLEPROC(EnableCap cap); + private PFNGLDISABLEPROC glDisable; + + public void Disable(EnableCap cap) + { + glDisable.Invoke(cap); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLENABLEPROC(EnableCap cap); + private PFNGLENABLEPROC glEnable; + + public void Enable(EnableCap cap) + { + glEnable.Invoke(cap); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFINISHPROC(); + private PFNGLFINISHPROC glFinish; + + public void Finish() + { + glFinish.Invoke(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFLUSHPROC(); + private PFNGLFLUSHPROC glFlush; + + public void Flush() + { + glFlush.Invoke(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBLENDFUNCPROC(BlendingFactor sfactor, BlendingFactor dfactor); + private PFNGLBLENDFUNCPROC glBlendFunc; + + public void BlendFunc(BlendingFactor sfactor, BlendingFactor dfactor) + { + glBlendFunc.Invoke(sfactor, dfactor); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLLOGICOPPROC(LogicOp opcode); + private PFNGLLOGICOPPROC glLogicOp; + + public void LogicOp(LogicOp opcode) + { + glLogicOp.Invoke(opcode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSTENCILFUNCPROC(StencilFunction func, int reference, uint mask); + private PFNGLSTENCILFUNCPROC glStencilFunc; + + public void StencilFunc(StencilFunction func, int reference, uint mask) + { + glStencilFunc.Invoke(func, reference, mask); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSTENCILOPPROC(StencilOp fail, StencilOp zfail, StencilOp zpass); + private PFNGLSTENCILOPPROC glStencilOp; + + public void StencilOp(StencilOp fail, StencilOp zfail, StencilOp zpass) + { + glStencilOp.Invoke(fail, zfail, zpass); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDEPTHFUNCPROC(DepthFunction func); + private PFNGLDEPTHFUNCPROC glDepthFunc; + + public void DepthFunc(DepthFunction func) + { + glDepthFunc.Invoke(func); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPIXELSTOREFPROC(PixelStoreParameter pname, float param); + private PFNGLPIXELSTOREFPROC glPixelStoref; + + public void PixelStoref(PixelStoreParameter pname, float param) + { + glPixelStoref.Invoke(pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPIXELSTOREIPROC(PixelStoreParameter pname, int param); + private PFNGLPIXELSTOREIPROC glPixelStorei; + + public void PixelStorei(PixelStoreParameter pname, int param) + { + glPixelStorei.Invoke(pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLREADBUFFERPROC(ReadBufferMode src); + private PFNGLREADBUFFERPROC glReadBuffer; + + public void ReadBuffer(ReadBufferMode src) + { + glReadBuffer.Invoke(src); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLREADPIXELSPROC(int x, int y, int width, int height, PixelFormat format, PixelType type, out IntPtr pixels); + private PFNGLREADPIXELSPROC glReadPixels; + + public void ReadPixels(int x, int y, int width, int height, PixelFormat format, PixelType type, out IntPtr pixels) + { + glReadPixels.Invoke(x, y, width, height, format, type, out pixels); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETBOOLEANVPROC(GetPName pname, out bool data); + private PFNGLGETBOOLEANVPROC glGetBooleanv; + + public void GetBooleanv(GetPName pname, out bool data) + { + glGetBooleanv.Invoke(pname, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETDOUBLEVPROC(GetPName pname, out double data); + private PFNGLGETDOUBLEVPROC glGetDoublev; + + public void GetDoublev(GetPName pname, out double data) + { + glGetDoublev.Invoke(pname, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate ErrorCode PFNGLGETERRORPROC(); + private PFNGLGETERRORPROC glGetError; + + public ErrorCode GetError() + { + return glGetError.Invoke(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETFLOATVPROC(GetPName pname, out float data); + private PFNGLGETFLOATVPROC glGetFloatv; + + public void GetFloatv(GetPName pname, out float data) + { + glGetFloatv.Invoke(pname, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETINTEGERVPROC(GetPName pname, out int data); + private PFNGLGETINTEGERVPROC glGetIntegerv; + + public void GetIntegerv(GetPName pname, out int data) + { + glGetIntegerv.Invoke(pname, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr PFNGLGETSTRINGPROC(StringName name); + private PFNGLGETSTRINGPROC glGetString; + + public IntPtr GetString(StringName name) + { + return glGetString.Invoke(name); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETTEXIMAGEPROC(TextureTarget target, int level, PixelFormat format, PixelType type, out IntPtr pixels); + private PFNGLGETTEXIMAGEPROC glGetTexImage; + + public void GetTexImage(TextureTarget target, int level, PixelFormat format, PixelType type, out IntPtr pixels) + { + glGetTexImage.Invoke(target, level, format, type, out pixels); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETTEXPARAMETERFVPROC(TextureTarget target, GetTextureParameter pname, out float parameters); + private PFNGLGETTEXPARAMETERFVPROC glGetTexParameterfv; + + public void GetTexParameterfv(TextureTarget target, GetTextureParameter pname, out float parameters) + { + glGetTexParameterfv.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETTEXPARAMETERIVPROC(TextureTarget target, GetTextureParameter pname, out int parameters); + private PFNGLGETTEXPARAMETERIVPROC glGetTexParameteriv; + + public void GetTexParameteriv(TextureTarget target, GetTextureParameter pname, out int parameters) + { + glGetTexParameteriv.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETTEXLEVELPARAMETERFVPROC(TextureTarget target, int level, GetTextureParameter pname, out float parameters); + private PFNGLGETTEXLEVELPARAMETERFVPROC glGetTexLevelParameterfv; + + public void GetTexLevelParameterfv(TextureTarget target, int level, GetTextureParameter pname, out float parameters) + { + glGetTexLevelParameterfv.Invoke(target, level, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETTEXLEVELPARAMETERIVPROC(TextureTarget target, int level, GetTextureParameter pname, out int parameters); + private PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv; + + public void GetTexLevelParameteriv(TextureTarget target, int level, GetTextureParameter pname, out int parameters) + { + glGetTexLevelParameteriv.Invoke(target, level, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISENABLEDPROC(EnableCap cap); + private PFNGLISENABLEDPROC glIsEnabled; + + public bool IsEnabled(EnableCap cap) + { + return glIsEnabled.Invoke(cap); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDEPTHRANGEPROC(double n, double f); + private PFNGLDEPTHRANGEPROC glDepthRange; + + public void DepthRange(double n, double f) + { + glDepthRange.Invoke(n, f); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVIEWPORTPROC(int x, int y, int width, int height); + private PFNGLVIEWPORTPROC glViewport; + + public void Viewport(int x, int y, int width, int height) + { + glViewport.Invoke(x, y, width, height); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWARRAYSPROC(PrimitiveType mode, int first, int count); + private PFNGLDRAWARRAYSPROC glDrawArrays; + + public void DrawArrays(PrimitiveType mode, int first, int count) + { + glDrawArrays.Invoke(mode, first, count); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWELEMENTSPROC(PrimitiveType mode, int count, DrawElementsType type, IntPtr indices); + private PFNGLDRAWELEMENTSPROC glDrawElements; + + public void DrawElements(PrimitiveType mode, int count, DrawElementsType type, IntPtr indices) + { + glDrawElements.Invoke(mode, count, type, indices); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPOLYGONOFFSETPROC(float factor, float units); + private PFNGLPOLYGONOFFSETPROC glPolygonOffset; + + public void PolygonOffset(float factor, float units) + { + glPolygonOffset.Invoke(factor, units); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOPYTEXIMAGE1DPROC(TextureTarget target, int level, InternalFormat internalformat, int x, int y, int width, int border); + private PFNGLCOPYTEXIMAGE1DPROC glCopyTexImage1D; + + public void CopyTexImage1D(TextureTarget target, int level, InternalFormat internalformat, int x, int y, int width, int border) + { + glCopyTexImage1D.Invoke(target, level, internalformat, x, y, width, border); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOPYTEXIMAGE2DPROC(TextureTarget target, int level, InternalFormat internalformat, int x, int y, int width, int height, int border); + private PFNGLCOPYTEXIMAGE2DPROC glCopyTexImage2D; + + public void CopyTexImage2D(TextureTarget target, int level, InternalFormat internalformat, int x, int y, int width, int height, int border) + { + glCopyTexImage2D.Invoke(target, level, internalformat, x, y, width, height, border); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOPYTEXSUBIMAGE1DPROC(TextureTarget target, int level, int xoffset, int x, int y, int width); + private PFNGLCOPYTEXSUBIMAGE1DPROC glCopyTexSubImage1D; + + public void CopyTexSubImage1D(TextureTarget target, int level, int xoffset, int x, int y, int width) + { + glCopyTexSubImage1D.Invoke(target, level, xoffset, x, y, width); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOPYTEXSUBIMAGE2DPROC(TextureTarget target, int level, int xoffset, int yoffset, int x, int y, int width, int height); + private PFNGLCOPYTEXSUBIMAGE2DPROC glCopyTexSubImage2D; + + public void CopyTexSubImage2D(TextureTarget target, int level, int xoffset, int yoffset, int x, int y, int width, int height) + { + glCopyTexSubImage2D.Invoke(target, level, xoffset, yoffset, x, y, width, height); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXSUBIMAGE1DPROC(TextureTarget target, int level, int xoffset, int width, PixelFormat format, PixelType type, IntPtr pixels); + private PFNGLTEXSUBIMAGE1DPROC glTexSubImage1D; + + public void TexSubImage1D(TextureTarget target, int level, int xoffset, int width, PixelFormat format, PixelType type, IntPtr pixels) + { + glTexSubImage1D.Invoke(target, level, xoffset, width, format, type, pixels); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXSUBIMAGE2DPROC(TextureTarget target, int level, int xoffset, int yoffset, int width, int height, PixelFormat format, PixelType type, IntPtr pixels); + private PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D; + + public void TexSubImage2D(TextureTarget target, int level, int xoffset, int yoffset, int width, int height, PixelFormat format, PixelType type, IntPtr pixels) + { + glTexSubImage2D.Invoke(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDTEXTUREPROC(TextureTarget target, uint texture); + private PFNGLBINDTEXTUREPROC glBindTexture; + + public void BindTexture(TextureTarget target, uint texture) + { + glBindTexture.Invoke(target, texture); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETETEXTURESPROC(int n, uint[] textures); + private PFNGLDELETETEXTURESPROC glDeleteTextures; + + public void DeleteTextures(int n, uint[] textures) + { + glDeleteTextures.Invoke(n, textures); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGENTEXTURESPROC(int n, uint[] textures); + private PFNGLGENTEXTURESPROC glGenTextures; + + public void GenTextures(int n, uint[] textures) + { + glGenTextures.Invoke(n, textures); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISTEXTUREPROC(uint texture); + private PFNGLISTEXTUREPROC glIsTexture; + + public bool IsTexture(uint texture) + { + return glIsTexture.Invoke(texture); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWRANGEELEMENTSPROC(PrimitiveType mode, uint start, uint end, int count, DrawElementsType type, IntPtr indices); + private PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements; + + public void DrawRangeElements(PrimitiveType mode, uint start, uint end, int count, DrawElementsType type, IntPtr indices) + { + glDrawRangeElements.Invoke(mode, start, end, count, type, indices); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXIMAGE3DPROC(TextureTarget target, int level, int internalformat, int width, int height, int depth, int border, PixelFormat format, PixelType type, IntPtr pixels); + private PFNGLTEXIMAGE3DPROC glTexImage3D; + + public void TexImage3D(TextureTarget target, int level, int internalformat, int width, int height, int depth, int border, PixelFormat format, PixelType type, IntPtr pixels) + { + glTexImage3D.Invoke(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXSUBIMAGE3DPROC(TextureTarget target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, PixelFormat format, PixelType type, IntPtr pixels); + private PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D; + + public void TexSubImage3D(TextureTarget target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, PixelFormat format, PixelType type, IntPtr pixels) + { + glTexSubImage3D.Invoke(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOPYTEXSUBIMAGE3DPROC(TextureTarget target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height); + private PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D; + + public void CopyTexSubImage3D(TextureTarget target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) + { + glCopyTexSubImage3D.Invoke(target, level, xoffset, yoffset, zoffset, x, y, width, height); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLACTIVETEXTUREPROC(TextureUnit texture); + private PFNGLACTIVETEXTUREPROC glActiveTexture; + + public void ActiveTexture(TextureUnit texture) + { + glActiveTexture.Invoke(texture); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSAMPLECOVERAGEPROC(float value, bool invert); + private PFNGLSAMPLECOVERAGEPROC glSampleCoverage; + + public void SampleCoverage(float value, bool invert) + { + glSampleCoverage.Invoke(value, invert); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOMPRESSEDTEXIMAGE3DPROC(TextureTarget target, int level, InternalFormat internalformat, int width, int height, int depth, int border, int imageSize, IntPtr data); + private PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D; + + public void CompressedTexImage3D(TextureTarget target, int level, InternalFormat internalformat, int width, int height, int depth, int border, int imageSize, IntPtr data) + { + glCompressedTexImage3D.Invoke(target, level, internalformat, width, height, depth, border, imageSize, data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOMPRESSEDTEXIMAGE2DPROC(TextureTarget target, int level, InternalFormat internalformat, int width, int height, int border, int imageSize, IntPtr data); + private PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D; + + public void CompressedTexImage2D(TextureTarget target, int level, InternalFormat internalformat, int width, int height, int border, int imageSize, IntPtr data) + { + glCompressedTexImage2D.Invoke(target, level, internalformat, width, height, border, imageSize, data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOMPRESSEDTEXIMAGE1DPROC(TextureTarget target, int level, InternalFormat internalformat, int width, int border, int imageSize, IntPtr data); + private PFNGLCOMPRESSEDTEXIMAGE1DPROC glCompressedTexImage1D; + + public void CompressedTexImage1D(TextureTarget target, int level, InternalFormat internalformat, int width, int border, int imageSize, IntPtr data) + { + glCompressedTexImage1D.Invoke(target, level, internalformat, width, border, imageSize, data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC(TextureTarget target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, PixelFormat format, int imageSize, IntPtr data); + private PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D; + + public void CompressedTexSubImage3D(TextureTarget target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, PixelFormat format, int imageSize, IntPtr data) + { + glCompressedTexSubImage3D.Invoke(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC(TextureTarget target, int level, int xoffset, int yoffset, int width, int height, PixelFormat format, int imageSize, IntPtr data); + private PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D; + + public void CompressedTexSubImage2D(TextureTarget target, int level, int xoffset, int yoffset, int width, int height, PixelFormat format, int imageSize, IntPtr data) + { + glCompressedTexSubImage2D.Invoke(target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC(TextureTarget target, int level, int xoffset, int width, PixelFormat format, int imageSize, IntPtr data); + private PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D; + + public void CompressedTexSubImage1D(TextureTarget target, int level, int xoffset, int width, PixelFormat format, int imageSize, IntPtr data) + { + glCompressedTexSubImage1D.Invoke(target, level, xoffset, width, format, imageSize, data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETCOMPRESSEDTEXIMAGEPROC(TextureTarget target, int level, out IntPtr img); + private PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage; + + public void GetCompressedTexImage(TextureTarget target, int level, out IntPtr img) + { + glGetCompressedTexImage.Invoke(target, level, out img); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBLENDFUNCSEPARATEPROC(BlendingFactor sfactorRGB, BlendingFactor dfactorRGB, BlendingFactor sfactorAlpha, BlendingFactor dfactorAlpha); + private PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate; + + public void BlendFuncSeparate(BlendingFactor sfactorRGB, BlendingFactor dfactorRGB, BlendingFactor sfactorAlpha, BlendingFactor dfactorAlpha) + { + glBlendFuncSeparate.Invoke(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLMULTIDRAWARRAYSPROC(PrimitiveType mode, int[] first, int[] count, int drawcount); + private PFNGLMULTIDRAWARRAYSPROC glMultiDrawArrays; + + public void MultiDrawArrays(PrimitiveType mode, int[] first, int[] count, int drawcount) + { + glMultiDrawArrays.Invoke(mode, first, count, drawcount); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLMULTIDRAWELEMENTSPROC(PrimitiveType mode, int[] count, DrawElementsType type, IntPtr indices, int drawcount); + private PFNGLMULTIDRAWELEMENTSPROC glMultiDrawElements; + + public void MultiDrawElements(PrimitiveType mode, int[] count, DrawElementsType type, IntPtr indices, int drawcount) + { + glMultiDrawElements.Invoke(mode, count, type, indices, drawcount); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPOINTPARAMETERFPROC(int pname, float param); + private PFNGLPOINTPARAMETERFPROC glPointParameterf; + + public void PointParameterf(int pname, float param) + { + glPointParameterf.Invoke(pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPOINTPARAMETERFVPROC(int pname, float[] parameters); + private PFNGLPOINTPARAMETERFVPROC glPointParameterfv; + + public void PointParameterfv(int pname, float[] parameters) + { + glPointParameterfv.Invoke(pname, parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPOINTPARAMETERIPROC(int pname, int param); + private PFNGLPOINTPARAMETERIPROC glPointParameteri; + + public void PointParameteri(int pname, int param) + { + glPointParameteri.Invoke(pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPOINTPARAMETERIVPROC(int pname, int[] parameters); + private PFNGLPOINTPARAMETERIVPROC glPointParameteriv; + + public void PointParameteriv(int pname, int[] parameters) + { + glPointParameteriv.Invoke(pname, parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBP4UIVPROC(uint index, VertexAttribPointerType type, bool normalized, uint[] value); + private PFNGLVERTEXATTRIBP4UIVPROC glVertexAttribP4uiv; + + public void VertexAttribP4uiv(uint index, VertexAttribPointerType type, bool normalized, uint[] value) + { + glVertexAttribP4uiv.Invoke(index, type, normalized, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBP4UIPROC(uint index, VertexAttribPointerType type, bool normalized, uint value); + private PFNGLVERTEXATTRIBP4UIPROC glVertexAttribP4ui; + + public void VertexAttribP4ui(uint index, VertexAttribPointerType type, bool normalized, uint value) + { + glVertexAttribP4ui.Invoke(index, type, normalized, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBP3UIVPROC(uint index, VertexAttribPointerType type, bool normalized, uint[] value); + private PFNGLVERTEXATTRIBP3UIVPROC glVertexAttribP3uiv; + + public void VertexAttribP3uiv(uint index, VertexAttribPointerType type, bool normalized, uint[] value) + { + glVertexAttribP3uiv.Invoke(index, type, normalized, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBP3UIPROC(uint index, VertexAttribPointerType type, bool normalized, uint value); + private PFNGLVERTEXATTRIBP3UIPROC glVertexAttribP3ui; + + public void VertexAttribP3ui(uint index, VertexAttribPointerType type, bool normalized, uint value) + { + glVertexAttribP3ui.Invoke(index, type, normalized, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBP2UIVPROC(uint index, VertexAttribPointerType type, bool normalized, uint[] value); + private PFNGLVERTEXATTRIBP2UIVPROC glVertexAttribP2uiv; + + public void VertexAttribP2uiv(uint index, VertexAttribPointerType type, bool normalized, uint[] value) + { + glVertexAttribP2uiv.Invoke(index, type, normalized, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBP2UIPROC(uint index, VertexAttribPointerType type, bool normalized, uint value); + private PFNGLVERTEXATTRIBP2UIPROC glVertexAttribP2ui; + + public void VertexAttribP2ui(uint index, VertexAttribPointerType type, bool normalized, uint value) + { + glVertexAttribP2ui.Invoke(index, type, normalized, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBP1UIVPROC(uint index, VertexAttribPointerType type, bool normalized, uint[] value); + private PFNGLVERTEXATTRIBP1UIVPROC glVertexAttribP1uiv; + + public void VertexAttribP1uiv(uint index, VertexAttribPointerType type, bool normalized, uint[] value) + { + glVertexAttribP1uiv.Invoke(index, type, normalized, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBP1UIPROC(uint index, VertexAttribPointerType type, bool normalized, uint value); + private PFNGLVERTEXATTRIBP1UIPROC glVertexAttribP1ui; + + public void VertexAttribP1ui(uint index, VertexAttribPointerType type, bool normalized, uint value) + { + glVertexAttribP1ui.Invoke(index, type, normalized, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBDIVISORPROC(uint index, uint divisor); + private PFNGLVERTEXATTRIBDIVISORPROC glVertexAttribDivisor; + + public void VertexAttribDivisor(uint index, uint divisor) + { + glVertexAttribDivisor.Invoke(index, divisor); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETQUERYOBJECTUI64VPROC(uint id, QueryObjectParameterName pname, out ulong parameters); + private PFNGLGETQUERYOBJECTUI64VPROC glGetQueryObjectui64v; + + public void GetQueryObjectui64v(uint id, QueryObjectParameterName pname, out ulong parameters) + { + glGetQueryObjectui64v.Invoke(id, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETQUERYOBJECTI64VPROC(uint id, QueryObjectParameterName pname, out long parameters); + private PFNGLGETQUERYOBJECTI64VPROC glGetQueryObjecti64v; + + public void GetQueryObjecti64v(uint id, QueryObjectParameterName pname, out long parameters) + { + glGetQueryObjecti64v.Invoke(id, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLQUERYCOUNTERPROC(uint id, QueryCounterTarget target); + private PFNGLQUERYCOUNTERPROC glQueryCounter; + + public void QueryCounter(uint id, QueryCounterTarget target) + { + glQueryCounter.Invoke(id, target); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETSAMPLERPARAMETERIUIVPROC(uint sampler, SamplerParameterName pname, out uint parameters); + private PFNGLGETSAMPLERPARAMETERIUIVPROC glGetSamplerParameterIuiv; + + public void GetSamplerParameterIuiv(uint sampler, SamplerParameterName pname, out uint parameters) + { + glGetSamplerParameterIuiv.Invoke(sampler, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETSAMPLERPARAMETERFVPROC(uint sampler, SamplerParameterName pname, out float parameters); + private PFNGLGETSAMPLERPARAMETERFVPROC glGetSamplerParameterfv; + + public void GetSamplerParameterfv(uint sampler, SamplerParameterName pname, out float parameters) + { + glGetSamplerParameterfv.Invoke(sampler, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETSAMPLERPARAMETERIIVPROC(uint sampler, SamplerParameterName pname, out int parameters); + private PFNGLGETSAMPLERPARAMETERIIVPROC glGetSamplerParameterIiv; + + public void GetSamplerParameterIiv(uint sampler, SamplerParameterName pname, out int parameters) + { + glGetSamplerParameterIiv.Invoke(sampler, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETSAMPLERPARAMETERIVPROC(uint sampler, SamplerParameterName pname, out int parameters); + private PFNGLGETSAMPLERPARAMETERIVPROC glGetSamplerParameteriv; + + public void GetSamplerParameteriv(uint sampler, SamplerParameterName pname, out int parameters) + { + glGetSamplerParameteriv.Invoke(sampler, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSAMPLERPARAMETERIUIVPROC(uint sampler, SamplerParameterName pname, uint[] param); + private PFNGLSAMPLERPARAMETERIUIVPROC glSamplerParameterIuiv; + + public void SamplerParameterIuiv(uint sampler, SamplerParameterName pname, uint[] param) + { + glSamplerParameterIuiv.Invoke(sampler, pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSAMPLERPARAMETERIIVPROC(uint sampler, SamplerParameterName pname, int[] param); + private PFNGLSAMPLERPARAMETERIIVPROC glSamplerParameterIiv; + + public void SamplerParameterIiv(uint sampler, SamplerParameterName pname, int[] param) + { + glSamplerParameterIiv.Invoke(sampler, pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSAMPLERPARAMETERFVPROC(uint sampler, SamplerParameterName pname, float[] param); + private PFNGLSAMPLERPARAMETERFVPROC glSamplerParameterfv; + + public void SamplerParameterfv(uint sampler, SamplerParameterName pname, float[] param) + { + glSamplerParameterfv.Invoke(sampler, pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSAMPLERPARAMETERFPROC(uint sampler, SamplerParameterName pname, float param); + private PFNGLSAMPLERPARAMETERFPROC glSamplerParameterf; + + public void SamplerParameterf(uint sampler, SamplerParameterName pname, float param) + { + glSamplerParameterf.Invoke(sampler, pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSAMPLERPARAMETERIVPROC(uint sampler, SamplerParameterName pname, int[] param); + private PFNGLSAMPLERPARAMETERIVPROC glSamplerParameteriv; + + public void SamplerParameteriv(uint sampler, SamplerParameterName pname, int[] param) + { + glSamplerParameteriv.Invoke(sampler, pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSAMPLERPARAMETERIPROC(uint sampler, SamplerParameterName pname, int param); + private PFNGLSAMPLERPARAMETERIPROC glSamplerParameteri; + + public void SamplerParameteri(uint sampler, SamplerParameterName pname, int param) + { + glSamplerParameteri.Invoke(sampler, pname, param); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDSAMPLERPROC(uint unit, uint sampler); + private PFNGLBINDSAMPLERPROC glBindSampler; + + public void BindSampler(uint unit, uint sampler) + { + glBindSampler.Invoke(unit, sampler); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISSAMPLERPROC(uint sampler); + private PFNGLISSAMPLERPROC glIsSampler; + + public bool IsSampler(uint sampler) + { + return glIsSampler.Invoke(sampler); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETESAMPLERSPROC(int count, uint[] samplers); + private PFNGLDELETESAMPLERSPROC glDeleteSamplers; + + public void DeleteSamplers(int count, uint[] samplers) + { + glDeleteSamplers.Invoke(count, samplers); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGENSAMPLERSPROC(int count, out uint samplers); + private PFNGLGENSAMPLERSPROC glGenSamplers; + + public void GenSamplers(int count, out uint samplers) + { + glGenSamplers.Invoke(count, out samplers); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int PFNGLGETFRAGDATAINDEXPROC(uint program, sbyte[] name); + private PFNGLGETFRAGDATAINDEXPROC glGetFragDataIndex; + + public int GetFragDataIndex(uint program, sbyte[] name) + { + return glGetFragDataIndex.Invoke(program, name); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDFRAGDATALOCATIONINDEXEDPROC(uint program, uint colorNumber, uint index, sbyte[] name); + private PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glBindFragDataLocationIndexed; + + public void BindFragDataLocationIndexed(uint program, uint colorNumber, uint index, sbyte[] name) + { + glBindFragDataLocationIndexed.Invoke(program, colorNumber, index, name); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBLENDCOLORPROC(float red, float green, float blue, float alpha); + private PFNGLBLENDCOLORPROC glBlendColor; + + public void BlendColor(float red, float green, float blue, float alpha) + { + glBlendColor.Invoke(red, green, blue, alpha); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBLENDEQUATIONPROC(BlendEquationModeEXT mode); + private PFNGLBLENDEQUATIONPROC glBlendEquation; + + public void BlendEquation(BlendEquationModeEXT mode) + { + glBlendEquation.Invoke(mode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGENQUERIESPROC(int n, out uint ids); + private PFNGLGENQUERIESPROC glGenQueries; + + public void GenQueries(int n, out uint ids) + { + glGenQueries.Invoke(n, out ids); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETEQUERIESPROC(int n, uint[] ids); + private PFNGLDELETEQUERIESPROC glDeleteQueries; + + public void DeleteQueries(int n, uint[] ids) + { + glDeleteQueries.Invoke(n, ids); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISQUERYPROC(uint id); + private PFNGLISQUERYPROC glIsQuery; + + public bool IsQuery(uint id) + { + return glIsQuery.Invoke(id); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBEGINQUERYPROC(QueryTarget target, uint id); + private PFNGLBEGINQUERYPROC glBeginQuery; + + public void BeginQuery(QueryTarget target, uint id) + { + glBeginQuery.Invoke(target, id); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLENDQUERYPROC(QueryTarget target); + private PFNGLENDQUERYPROC glEndQuery; + + public void EndQuery(QueryTarget target) + { + glEndQuery.Invoke(target); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETQUERYIVPROC(QueryTarget target, QueryParameterName pname, out int parameters); + private PFNGLGETQUERYIVPROC glGetQueryiv; + + public void GetQueryiv(QueryTarget target, QueryParameterName pname, out int parameters) + { + glGetQueryiv.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETQUERYOBJECTIVPROC(uint id, QueryObjectParameterName pname, out int parameters); + private PFNGLGETQUERYOBJECTIVPROC glGetQueryObjectiv; + + public void GetQueryObjectiv(uint id, QueryObjectParameterName pname, out int parameters) + { + glGetQueryObjectiv.Invoke(id, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETQUERYOBJECTUIVPROC(uint id, QueryObjectParameterName pname, out uint parameters); + private PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectuiv; + + public void GetQueryObjectuiv(uint id, QueryObjectParameterName pname, out uint parameters) + { + glGetQueryObjectuiv.Invoke(id, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDBUFFERPROC(BufferTargetARB target, uint buffer); + private PFNGLBINDBUFFERPROC glBindBuffer; + + public void BindBuffer(BufferTargetARB target, uint buffer) + { + glBindBuffer.Invoke(target, buffer); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETEBUFFERSPROC(int n, uint[] buffers); + private PFNGLDELETEBUFFERSPROC glDeleteBuffers; + + public void DeleteBuffers(int n, uint[] buffers) + { + glDeleteBuffers.Invoke(n, buffers); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGENBUFFERSPROC(int n, uint[] buffers); + private PFNGLGENBUFFERSPROC glGenBuffers; + + public void GenBuffers(int n, uint[] buffers) + { + glGenBuffers.Invoke(n, buffers); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISBUFFERPROC(uint buffer); + private PFNGLISBUFFERPROC glIsBuffer; + + public bool IsBuffer(uint buffer) + { + return glIsBuffer.Invoke(buffer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBUFFERDATAPROC(BufferTargetARB target, uint size, IntPtr data, BufferUsageARB usage); + private PFNGLBUFFERDATAPROC glBufferData; + + public void BufferData(BufferTargetARB target, uint size, IntPtr data, BufferUsageARB usage) + { + glBufferData.Invoke(target, size, data, usage); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBUFFERSUBDATAPROC(BufferTargetARB target, IntPtr offset, IntPtr size, IntPtr data); + private PFNGLBUFFERSUBDATAPROC glBufferSubData; + + public void BufferSubData(BufferTargetARB target, IntPtr offset, IntPtr size, IntPtr data) + { + glBufferSubData.Invoke(target, offset, size, data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETBUFFERSUBDATAPROC(BufferTargetARB target, IntPtr offset, IntPtr size, out IntPtr data); + private PFNGLGETBUFFERSUBDATAPROC glGetBufferSubData; + + public void GetBufferSubData(BufferTargetARB target, IntPtr offset, IntPtr size, out IntPtr data) + { + glGetBufferSubData.Invoke(target, offset, size, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr PFNGLMAPBUFFERPROC(BufferTargetARB target, BufferAccessARB access); + private PFNGLMAPBUFFERPROC glMapBuffer; + + public IntPtr MapBuffer(BufferTargetARB target, BufferAccessARB access) + { + return glMapBuffer.Invoke(target, access); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLUNMAPBUFFERPROC(BufferTargetARB target); + private PFNGLUNMAPBUFFERPROC glUnmapBuffer; + + public bool UnmapBuffer(BufferTargetARB target) + { + return glUnmapBuffer.Invoke(target); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETBUFFERPARAMETERIVPROC(BufferTargetARB target, int pname, out int parameters); + private PFNGLGETBUFFERPARAMETERIVPROC glGetBufferParameteriv; + + public void GetBufferParameteriv(BufferTargetARB target, int pname, out int parameters) + { + glGetBufferParameteriv.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETBUFFERPOINTERVPROC(BufferTargetARB target, int pname, out IntPtr parameters); + private PFNGLGETBUFFERPOINTERVPROC glGetBufferPointerv; + + public void GetBufferPointerv(BufferTargetARB target, int pname, out IntPtr parameters) + { + glGetBufferPointerv.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBLENDEQUATIONSEPARATEPROC(BlendEquationModeEXT modeRGB, BlendEquationModeEXT modeAlpha); + private PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate; + + public void BlendEquationSeparate(BlendEquationModeEXT modeRGB, BlendEquationModeEXT modeAlpha) + { + glBlendEquationSeparate.Invoke(modeRGB, modeAlpha); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWBUFFERSPROC(int n, int[] bufs); + private PFNGLDRAWBUFFERSPROC glDrawBuffers; + + public void DrawBuffers(int n, int[] bufs) + { + glDrawBuffers.Invoke(n, bufs); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSTENCILOPSEPARATEPROC(StencilFaceDirection face, StencilOp sfail, StencilOp dpfail, StencilOp dppass); + private PFNGLSTENCILOPSEPARATEPROC glStencilOpSeparate; + + public void StencilOpSeparate(StencilFaceDirection face, StencilOp sfail, StencilOp dpfail, StencilOp dppass) + { + glStencilOpSeparate.Invoke(face, sfail, dpfail, dppass); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSTENCILFUNCSEPARATEPROC(StencilFaceDirection face, StencilFunction func, int reference, uint mask); + private PFNGLSTENCILFUNCSEPARATEPROC glStencilFuncSeparate; + + public void StencilFuncSeparate(StencilFaceDirection face, StencilFunction func, int reference, uint mask) + { + glStencilFuncSeparate.Invoke(face, func, reference, mask); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSTENCILMASKSEPARATEPROC(StencilFaceDirection face, uint mask); + private PFNGLSTENCILMASKSEPARATEPROC glStencilMaskSeparate; + + public void StencilMaskSeparate(StencilFaceDirection face, uint mask) + { + glStencilMaskSeparate.Invoke(face, mask); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLATTACHSHADERPROC(uint program, uint shader); + private PFNGLATTACHSHADERPROC glAttachShader; + + public void AttachShader(uint program, uint shader) + { + glAttachShader.Invoke(program, shader); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDATTRIBLOCATIONPROC(uint program, uint index, sbyte[] name); + private PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation; + + public void BindAttribLocation(uint program, uint index, sbyte[] name) + { + glBindAttribLocation.Invoke(program, index, name); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOMPILESHADERPROC(uint shader); + private PFNGLCOMPILESHADERPROC glCompileShader; + + public void CompileShader(uint shader) + { + glCompileShader.Invoke(shader); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate uint PFNGLCREATEPROGRAMPROC(); + private PFNGLCREATEPROGRAMPROC glCreateProgram; + + public uint CreateProgram() + { + uint handle = glCreateProgram.Invoke(); + DetectGLError(); + return handle; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate uint PFNGLCREATESHADERPROC(ShaderType type); + private PFNGLCREATESHADERPROC glCreateShader; + + public uint CreateShader(ShaderType type) + { + uint handle = glCreateShader.Invoke(type); + DetectGLError(); + return handle; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETEPROGRAMPROC(uint program); + private PFNGLDELETEPROGRAMPROC glDeleteProgram; + + public void DeleteProgram(uint program) + { + glDeleteProgram.Invoke(program); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETESHADERPROC(uint shader); + private PFNGLDELETESHADERPROC glDeleteShader; + + public void DeleteShader(uint shader) + { + glDeleteShader.Invoke(shader); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDETACHSHADERPROC(uint program, uint shader); + private PFNGLDETACHSHADERPROC glDetachShader; + + public void DetachShader(uint program, uint shader) + { + glDetachShader.Invoke(program, shader); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDISABLEVERTEXATTRIBARRAYPROC(uint index); + private PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray; + + public void DisableVertexAttribArray(uint index) + { + glDisableVertexAttribArray.Invoke(index); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLENABLEVERTEXATTRIBARRAYPROC(uint index); + private PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray; + + public void EnableVertexAttribArray(uint index) + { + glEnableVertexAttribArray.Invoke(index); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETACTIVEATTRIBPROC(uint program, uint index, int bufSize, out int length, out int size, out AttributeType type, out sbyte name); + private PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib; + + public void GetActiveAttrib(uint program, uint index, int bufSize, out int length, out int size, out AttributeType type, out sbyte name) + { + glGetActiveAttrib.Invoke(program, index, bufSize, out length, out size, out type, out name); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETACTIVEUNIFORMPROC(uint program, uint index, int bufSize, out int length, out int size, out AttributeType type, out sbyte name); + private PFNGLGETACTIVEUNIFORMPROC glGetActiveUniform; + + public void GetActiveUniform(uint program, uint index, int bufSize, out int length, out int size, out AttributeType type, out sbyte name) + { + glGetActiveUniform.Invoke(program, index, bufSize, out length, out size, out type, out name); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETATTACHEDSHADERSPROC(uint program, int maxCount, out int count, out uint shaders); + private PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders; + + public void GetAttachedShaders(uint program, int maxCount, out int count, out uint shaders) + { + glGetAttachedShaders.Invoke(program, maxCount, out count, out shaders); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int PFNGLGETATTRIBLOCATIONPROC(uint program, string name); + private PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation; + + public int GetAttribLocation(uint program, string name) + { + int loc = glGetAttribLocation.Invoke(program, name); + DetectGLError(); + return loc; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETPROGRAMIVPROC(uint program, ProgramPropertyARB pname, out int parameters); + private PFNGLGETPROGRAMIVPROC glGetProgramiv; + + public void GetProgramiv(uint program, ProgramPropertyARB pname, out int parameters) + { + glGetProgramiv.Invoke(program, pname, out parameters); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETPROGRAMINFOLOGPROC(uint program, int bufSize, out int length, byte[] infoLog); + private PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog; + + public void GetProgramInfoLog(uint program, int bufSize, out int length, byte[] infoLog) + { + glGetProgramInfoLog.Invoke(program, bufSize, out length, infoLog); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETSHADERIVPROC(uint shader, ShaderParameterName pname, out int parameters); + private PFNGLGETSHADERIVPROC glGetShaderiv; + + public void GetShaderiv(uint shader, ShaderParameterName pname, out int parameters) + { + glGetShaderiv.Invoke(shader, pname, out parameters); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETSHADERINFOLOGPROC(uint shader, int bufSize, out int length, byte[] infoLog); + private PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog; + + public void GetShaderInfoLog(uint shader, int bufSize, out int length, byte[] infoLog) + { + glGetShaderInfoLog.Invoke(shader, bufSize, out length, infoLog); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETSHADERSOURCEPROC(uint shader, int bufSize, out int length, out sbyte source); + private PFNGLGETSHADERSOURCEPROC glGetShaderSource; + + public void GetShaderSource(uint shader, int bufSize, out int length, out sbyte source) + { + glGetShaderSource.Invoke(shader, bufSize, out length, out source); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int PFNGLGETUNIFORMLOCATIONPROC(uint program, string name); + private PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation; + + public int GetUniformLocation(uint program, string name) + { + int loc = glGetUniformLocation.Invoke(program, name); + DetectGLError(); + return loc; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETUNIFORMFVPROC(uint program, int location, out float parameters); + private PFNGLGETUNIFORMFVPROC glGetUniformfv; + + public void GetUniformfv(uint program, int location, out float parameters) + { + glGetUniformfv.Invoke(program, location, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETUNIFORMIVPROC(uint program, int location, out int parameters); + private PFNGLGETUNIFORMIVPROC glGetUniformiv; + + public void GetUniformiv(uint program, int location, out int parameters) + { + glGetUniformiv.Invoke(program, location, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETVERTEXATTRIBDVPROC(uint index, int pname, out double parameters); + private PFNGLGETVERTEXATTRIBDVPROC glGetVertexAttribdv; + + public void GetVertexAttribdv(uint index, int pname, out double parameters) + { + glGetVertexAttribdv.Invoke(index, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETVERTEXATTRIBFVPROC(uint index, int pname, out float parameters); + private PFNGLGETVERTEXATTRIBFVPROC glGetVertexAttribfv; + + public void GetVertexAttribfv(uint index, int pname, out float parameters) + { + glGetVertexAttribfv.Invoke(index, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETVERTEXATTRIBIVPROC(uint index, int pname, out int parameters); + private PFNGLGETVERTEXATTRIBIVPROC glGetVertexAttribiv; + + public void GetVertexAttribiv(uint index, int pname, out int parameters) + { + glGetVertexAttribiv.Invoke(index, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETVERTEXATTRIBPOINTERVPROC(uint index, int pname, out IntPtr pointer); + private PFNGLGETVERTEXATTRIBPOINTERVPROC glGetVertexAttribPointerv; + + public void GetVertexAttribPointerv(uint index, int pname, out IntPtr pointer) + { + glGetVertexAttribPointerv.Invoke(index, pname, out pointer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISPROGRAMPROC(uint program); + private PFNGLISPROGRAMPROC glIsProgram; + + public bool IsProgram(uint program) + { + return glIsProgram.Invoke(program); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISSHADERPROC(uint shader); + private PFNGLISSHADERPROC glIsShader; + + public bool IsShader(uint shader) + { + return glIsShader.Invoke(shader); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLLINKPROGRAMPROC(uint program); + private PFNGLLINKPROGRAMPROC glLinkProgram; + + public void LinkProgram(uint program) + { + glLinkProgram.Invoke(program); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSHADERSOURCEPROC(uint shader, int count, string[] str, int[] length); + private PFNGLSHADERSOURCEPROC glShaderSource; + + public void ShaderSource(uint shader, int count, string[] str, int[] length) + { + glShaderSource.Invoke(shader, count, str, length); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUSEPROGRAMPROC(uint program); + private PFNGLUSEPROGRAMPROC glUseProgram; + + public void UseProgram(uint program) + { + glUseProgram.Invoke(program); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM1FPROC(int location, float v0); + private PFNGLUNIFORM1FPROC glUniform1f; + + public void Uniform1f(int location, float v0) + { + glUniform1f.Invoke(location, v0); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM2FPROC(int location, float v0, float v1); + private PFNGLUNIFORM2FPROC glUniform2f; + + public void Uniform2f(int location, float v0, float v1) + { + glUniform2f.Invoke(location, v0, v1); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM3FPROC(int location, float v0, float v1, float v2); + private PFNGLUNIFORM3FPROC glUniform3f; + + public void Uniform3f(int location, float v0, float v1, float v2) + { + glUniform3f.Invoke(location, v0, v1, v2); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM4FPROC(int location, float v0, float v1, float v2, float v3); + private PFNGLUNIFORM4FPROC glUniform4f; + + public void Uniform4f(int location, float v0, float v1, float v2, float v3) + { + glUniform4f.Invoke(location, v0, v1, v2, v3); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM1IPROC(int location, int v0); + private PFNGLUNIFORM1IPROC glUniform1i; + + public void Uniform1i(int location, int v0) + { + glUniform1i.Invoke(location, v0); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM2IPROC(int location, int v0, int v1); + private PFNGLUNIFORM2IPROC glUniform2i; + + public void Uniform2i(int location, int v0, int v1) + { + glUniform2i.Invoke(location, v0, v1); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM3IPROC(int location, int v0, int v1, int v2); + private PFNGLUNIFORM3IPROC glUniform3i; + + public void Uniform3i(int location, int v0, int v1, int v2) + { + glUniform3i.Invoke(location, v0, v1, v2); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM4IPROC(int location, int v0, int v1, int v2, int v3); + private PFNGLUNIFORM4IPROC glUniform4i; + + public void Uniform4i(int location, int v0, int v1, int v2, int v3) + { + glUniform4i.Invoke(location, v0, v1, v2, v3); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM1FVPROC(int location, int count, float[] value); + private PFNGLUNIFORM1FVPROC glUniform1fv; + + public void Uniform1fv(int location, int count, float[] value) + { + glUniform1fv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM2FVPROC(int location, int count, float[] value); + private PFNGLUNIFORM2FVPROC glUniform2fv; + + public void Uniform2fv(int location, int count, float[] value) + { + glUniform2fv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM3FVPROC(int location, int count, float[] value); + private PFNGLUNIFORM3FVPROC glUniform3fv; + + public void Uniform3fv(int location, int count, float[] value) + { + glUniform3fv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM4FVPROC(int location, int count, float[] value); + private PFNGLUNIFORM4FVPROC glUniform4fv; + + public void Uniform4fv(int location, int count, float[] value) + { + glUniform4fv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM1IVPROC(int location, int count, int[] value); + private PFNGLUNIFORM1IVPROC glUniform1iv; + + public void Uniform1iv(int location, int count, int[] value) + { + glUniform1iv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM2IVPROC(int location, int count, int[] value); + private PFNGLUNIFORM2IVPROC glUniform2iv; + + public void Uniform2iv(int location, int count, int[] value) + { + glUniform2iv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM3IVPROC(int location, int count, int[] value); + private PFNGLUNIFORM3IVPROC glUniform3iv; + + public void Uniform3iv(int location, int count, int[] value) + { + glUniform3iv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM4IVPROC(int location, int count, int[] value); + private PFNGLUNIFORM4IVPROC glUniform4iv; + + public void Uniform4iv(int location, int count, int[] value) + { + glUniform4iv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX2FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv; + + public void UniformMatrix2fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix2fv.Invoke(location, count, transpose, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX3FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv; + + public void UniformMatrix3fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix3fv.Invoke(location, count, transpose, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX4FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv; + + public void UniformMatrix4fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix4fv.Invoke(location, count, transpose, value); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVALIDATEPROGRAMPROC(uint program); + private PFNGLVALIDATEPROGRAMPROC glValidateProgram; + + public void ValidateProgram(uint program) + { + glValidateProgram.Invoke(program); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB1DPROC(uint index, double x); + private PFNGLVERTEXATTRIB1DPROC glVertexAttrib1d; + + public void VertexAttrib1d(uint index, double x) + { + glVertexAttrib1d.Invoke(index, x); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB1DVPROC(uint index, double[] v); + private PFNGLVERTEXATTRIB1DVPROC glVertexAttrib1dv; + + public void VertexAttrib1dv(uint index, double[] v) + { + glVertexAttrib1dv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB1FPROC(uint index, float x); + private PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f; + + public void VertexAttrib1f(uint index, float x) + { + glVertexAttrib1f.Invoke(index, x); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB1FVPROC(uint index, float[] v); + private PFNGLVERTEXATTRIB1FVPROC glVertexAttrib1fv; + + public void VertexAttrib1fv(uint index, float[] v) + { + glVertexAttrib1fv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB1SPROC(uint index, short x); + private PFNGLVERTEXATTRIB1SPROC glVertexAttrib1s; + + public void VertexAttrib1s(uint index, short x) + { + glVertexAttrib1s.Invoke(index, x); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB1SVPROC(uint index, short[] v); + private PFNGLVERTEXATTRIB1SVPROC glVertexAttrib1sv; + + public void VertexAttrib1sv(uint index, short[] v) + { + glVertexAttrib1sv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB2DPROC(uint index, double x, double y); + private PFNGLVERTEXATTRIB2DPROC glVertexAttrib2d; + + public void VertexAttrib2d(uint index, double x, double y) + { + glVertexAttrib2d.Invoke(index, x, y); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB2DVPROC(uint index, double[] v); + private PFNGLVERTEXATTRIB2DVPROC glVertexAttrib2dv; + + public void VertexAttrib2dv(uint index, double[] v) + { + glVertexAttrib2dv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB2FPROC(uint index, float x, float y); + private PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f; + + public void VertexAttrib2f(uint index, float x, float y) + { + glVertexAttrib2f.Invoke(index, x, y); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB2FVPROC(uint index, float[] v); + private PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv; + + public void VertexAttrib2fv(uint index, float[] v) + { + glVertexAttrib2fv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB2SPROC(uint index, short x, short y); + private PFNGLVERTEXATTRIB2SPROC glVertexAttrib2s; + + public void VertexAttrib2s(uint index, short x, short y) + { + glVertexAttrib2s.Invoke(index, x, y); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB2SVPROC(uint index, short[] v); + private PFNGLVERTEXATTRIB2SVPROC glVertexAttrib2sv; + + public void VertexAttrib2sv(uint index, short[] v) + { + glVertexAttrib2sv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB3DPROC(uint index, double x, double y, double z); + private PFNGLVERTEXATTRIB3DPROC glVertexAttrib3d; + + public void VertexAttrib3d(uint index, double x, double y, double z) + { + glVertexAttrib3d.Invoke(index, x, y, z); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB3DVPROC(uint index, double[] v); + private PFNGLVERTEXATTRIB3DVPROC glVertexAttrib3dv; + + public void VertexAttrib3dv(uint index, double[] v) + { + glVertexAttrib3dv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB3FPROC(uint index, float x, float y, float z); + private PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f; + + public void VertexAttrib3f(uint index, float x, float y, float z) + { + glVertexAttrib3f.Invoke(index, x, y, z); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB3FVPROC(uint index, float[] v); + private PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv; + + public void VertexAttrib3fv(uint index, float[] v) + { + glVertexAttrib3fv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB3SPROC(uint index, short x, short y, short z); + private PFNGLVERTEXATTRIB3SPROC glVertexAttrib3s; + + public void VertexAttrib3s(uint index, short x, short y, short z) + { + glVertexAttrib3s.Invoke(index, x, y, z); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB3SVPROC(uint index, short[] v); + private PFNGLVERTEXATTRIB3SVPROC glVertexAttrib3sv; + + public void VertexAttrib3sv(uint index, short[] v) + { + glVertexAttrib3sv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4NBVPROC(uint index, sbyte[] v); + private PFNGLVERTEXATTRIB4NBVPROC glVertexAttrib4Nbv; + + public void VertexAttrib4Nbv(uint index, sbyte[] v) + { + glVertexAttrib4Nbv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4NIVPROC(uint index, int[] v); + private PFNGLVERTEXATTRIB4NIVPROC glVertexAttrib4Niv; + + public void VertexAttrib4Niv(uint index, int[] v) + { + glVertexAttrib4Niv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4NSVPROC(uint index, short[] v); + private PFNGLVERTEXATTRIB4NSVPROC glVertexAttrib4Nsv; + + public void VertexAttrib4Nsv(uint index, short[] v) + { + glVertexAttrib4Nsv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4NUBPROC(uint index, byte x, byte y, byte z, byte w); + private PFNGLVERTEXATTRIB4NUBPROC glVertexAttrib4Nub; + + public void VertexAttrib4Nub(uint index, byte x, byte y, byte z, byte w) + { + glVertexAttrib4Nub.Invoke(index, x, y, z, w); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4NUBVPROC(uint index, byte[] v); + private PFNGLVERTEXATTRIB4NUBVPROC glVertexAttrib4Nubv; + + public void VertexAttrib4Nubv(uint index, byte[] v) + { + glVertexAttrib4Nubv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4NUIVPROC(uint index, uint[] v); + private PFNGLVERTEXATTRIB4NUIVPROC glVertexAttrib4Nuiv; + + public void VertexAttrib4Nuiv(uint index, uint[] v) + { + glVertexAttrib4Nuiv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4NUSVPROC(uint index, ushort[] v); + private PFNGLVERTEXATTRIB4NUSVPROC glVertexAttrib4Nusv; + + public void VertexAttrib4Nusv(uint index, ushort[] v) + { + glVertexAttrib4Nusv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4BVPROC(uint index, sbyte[] v); + private PFNGLVERTEXATTRIB4BVPROC glVertexAttrib4bv; + + public void VertexAttrib4bv(uint index, sbyte[] v) + { + glVertexAttrib4bv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4DPROC(uint index, double x, double y, double z, double w); + private PFNGLVERTEXATTRIB4DPROC glVertexAttrib4d; + + public void VertexAttrib4d(uint index, double x, double y, double z, double w) + { + glVertexAttrib4d.Invoke(index, x, y, z, w); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4DVPROC(uint index, double[] v); + private PFNGLVERTEXATTRIB4DVPROC glVertexAttrib4dv; + + public void VertexAttrib4dv(uint index, double[] v) + { + glVertexAttrib4dv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4FPROC(uint index, float x, float y, float z, float w); + private PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f; + + public void VertexAttrib4f(uint index, float x, float y, float z, float w) + { + glVertexAttrib4f.Invoke(index, x, y, z, w); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4FVPROC(uint index, float[] v); + private PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv; + + public void VertexAttrib4fv(uint index, float[] v) + { + glVertexAttrib4fv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4IVPROC(uint index, int[] v); + private PFNGLVERTEXATTRIB4IVPROC glVertexAttrib4iv; + + public void VertexAttrib4iv(uint index, int[] v) + { + glVertexAttrib4iv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4SPROC(uint index, short x, short y, short z, short w); + private PFNGLVERTEXATTRIB4SPROC glVertexAttrib4s; + + public void VertexAttrib4s(uint index, short x, short y, short z, short w) + { + glVertexAttrib4s.Invoke(index, x, y, z, w); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4SVPROC(uint index, short[] v); + private PFNGLVERTEXATTRIB4SVPROC glVertexAttrib4sv; + + public void VertexAttrib4sv(uint index, short[] v) + { + glVertexAttrib4sv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4UBVPROC(uint index, byte[] v); + private PFNGLVERTEXATTRIB4UBVPROC glVertexAttrib4ubv; + + public void VertexAttrib4ubv(uint index, byte[] v) + { + glVertexAttrib4ubv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4UIVPROC(uint index, uint[] v); + private PFNGLVERTEXATTRIB4UIVPROC glVertexAttrib4uiv; + + public void VertexAttrib4uiv(uint index, uint[] v) + { + glVertexAttrib4uiv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIB4USVPROC(uint index, ushort[] v); + private PFNGLVERTEXATTRIB4USVPROC glVertexAttrib4usv; + + public void VertexAttrib4usv(uint index, ushort[] v) + { + glVertexAttrib4usv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBPOINTERPROC(uint index, int size, VertexAttribPointerType type, bool normalized, uint stride, IntPtr pointer); + private PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer; + + public void VertexAttribPointer(uint index, int size, VertexAttribPointerType type, bool normalized, uint stride, IntPtr pointer) + { + glVertexAttribPointer.Invoke(index, size, type, normalized, stride, pointer); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX2X3FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv; + + public void UniformMatrix2x3fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix2x3fv.Invoke(location, count, transpose, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX3X2FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX3X2FVPROC glUniformMatrix3x2fv; + + public void UniformMatrix3x2fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix3x2fv.Invoke(location, count, transpose, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX2X4FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv; + + public void UniformMatrix2x4fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix2x4fv.Invoke(location, count, transpose, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX4X2FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX4X2FVPROC glUniformMatrix4x2fv; + + public void UniformMatrix4x2fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix4x2fv.Invoke(location, count, transpose, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX3X4FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv; + + public void UniformMatrix3x4fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix3x4fv.Invoke(location, count, transpose, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMMATRIX4X3FVPROC(int location, int count, bool transpose, float[] value); + private PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv; + + public void UniformMatrix4x3fv(int location, int count, bool transpose, float[] value) + { + glUniformMatrix4x3fv.Invoke(location, count, transpose, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOLORMASKIPROC(uint index, bool r, bool g, bool b, bool a); + private PFNGLCOLORMASKIPROC glColorMaski; + + public void ColorMaski(uint index, bool r, bool g, bool b, bool a) + { + glColorMaski.Invoke(index, r, g, b, a); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETBOOLEANI_VPROC(BufferTargetARB target, uint index, out bool data); + private PFNGLGETBOOLEANI_VPROC glGetBooleani_v; + + public void GetBooleani_v(BufferTargetARB target, uint index, out bool data) + { + glGetBooleani_v.Invoke(target, index, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETINTEGERI_VPROC(TypeEnum target, uint index, out int data); + private PFNGLGETINTEGERI_VPROC glGetIntegeri_v; + + public void GetIntegeri_v(TypeEnum target, uint index, out int data) + { + glGetIntegeri_v.Invoke(target, index, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLENABLEIPROC(EnableCap target, uint index); + private PFNGLENABLEIPROC glEnablei; + + public void Enablei(EnableCap target, uint index) + { + glEnablei.Invoke(target, index); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDISABLEIPROC(EnableCap target, uint index); + private PFNGLDISABLEIPROC glDisablei; + + public void Disablei(EnableCap target, uint index) + { + glDisablei.Invoke(target, index); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISENABLEDIPROC(EnableCap target, uint index); + private PFNGLISENABLEDIPROC glIsEnabledi; + + public bool IsEnabledi(EnableCap target, uint index) + { + return glIsEnabledi.Invoke(target, index); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBEGINTRANSFORMFEEDBACKPROC(PrimitiveType primitiveMode); + private PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback; + + public void BeginTransformFeedback(PrimitiveType primitiveMode) + { + glBeginTransformFeedback.Invoke(primitiveMode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLENDTRANSFORMFEEDBACKPROC(); + private PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback; + + public void EndTransformFeedback() + { + glEndTransformFeedback.Invoke(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDBUFFERRANGEPROC(BufferTargetARB target, uint index, uint buffer, IntPtr offset, IntPtr size); + private PFNGLBINDBUFFERRANGEPROC glBindBufferRange; + + public void BindBufferRange(BufferTargetARB target, uint index, uint buffer, IntPtr offset, IntPtr size) + { + glBindBufferRange.Invoke(target, index, buffer, offset, size); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDBUFFERBASEPROC(BufferTargetARB target, uint index, uint buffer); + private PFNGLBINDBUFFERBASEPROC glBindBufferBase; + + public void BindBufferBase(BufferTargetARB target, uint index, uint buffer) + { + glBindBufferBase.Invoke(target, index, buffer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTRANSFORMFEEDBACKVARYINGSPROC(uint program, int count, sbyte varyings, int bufferMode); + private PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings; + + public void TransformFeedbackVaryings(uint program, int count, sbyte varyings, int bufferMode) + { + glTransformFeedbackVaryings.Invoke(program, count, varyings, bufferMode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETTRANSFORMFEEDBACKVARYINGPROC(uint program, uint index, int bufSize, out int length, out int size, out int type, out sbyte name); + private PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glGetTransformFeedbackVarying; + + public void GetTransformFeedbackVarying(uint program, uint index, int bufSize, out int length, out int size, out int type, out sbyte name) + { + glGetTransformFeedbackVarying.Invoke(program, index, bufSize, out length, out size, out type, out name); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLAMPCOLORPROC(int target, int clamp); + private PFNGLCLAMPCOLORPROC glClampColor; + + public void ClampColor(int target, int clamp) + { + glClampColor.Invoke(target, clamp); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBEGINCONDITIONALRENDERPROC(uint id, TypeEnum mode); + private PFNGLBEGINCONDITIONALRENDERPROC glBeginConditionalRender; + + public void BeginConditionalRender(uint id, TypeEnum mode) + { + glBeginConditionalRender.Invoke(id, mode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLENDCONDITIONALRENDERPROC(); + private PFNGLENDCONDITIONALRENDERPROC glEndConditionalRender; + + public void EndConditionalRender() + { + glEndConditionalRender.Invoke(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBIPOINTERPROC(uint index, int size, VertexAttribPointerType type, int stride, IntPtr pointer); + private PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer; + + public void VertexAttribIPointer(uint index, int size, VertexAttribPointerType type, int stride, IntPtr pointer) + { + glVertexAttribIPointer.Invoke(index, size, type, stride, pointer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETVERTEXATTRIBIIVPROC(uint index, VertexAttribEnum pname, out int parameters); + private PFNGLGETVERTEXATTRIBIIVPROC glGetVertexAttribIiv; + + public void GetVertexAttribIiv(uint index, VertexAttribEnum pname, out int parameters) + { + glGetVertexAttribIiv.Invoke(index, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETVERTEXATTRIBIUIVPROC(uint index, VertexAttribEnum pname, out uint parameters); + private PFNGLGETVERTEXATTRIBIUIVPROC glGetVertexAttribIuiv; + + public void GetVertexAttribIuiv(uint index, VertexAttribEnum pname, out uint parameters) + { + glGetVertexAttribIuiv.Invoke(index, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI1IPROC(uint index, int x); + private PFNGLVERTEXATTRIBI1IPROC glVertexAttribI1i; + + public void VertexAttribI1i(uint index, int x) + { + glVertexAttribI1i.Invoke(index, x); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI2IPROC(uint index, int x, int y); + private PFNGLVERTEXATTRIBI2IPROC glVertexAttribI2i; + + public void VertexAttribI2i(uint index, int x, int y) + { + glVertexAttribI2i.Invoke(index, x, y); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI3IPROC(uint index, int x, int y, int z); + private PFNGLVERTEXATTRIBI3IPROC glVertexAttribI3i; + + public void VertexAttribI3i(uint index, int x, int y, int z) + { + glVertexAttribI3i.Invoke(index, x, y, z); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI4IPROC(uint index, int x, int y, int z, int w); + private PFNGLVERTEXATTRIBI4IPROC glVertexAttribI4i; + + public void VertexAttribI4i(uint index, int x, int y, int z, int w) + { + glVertexAttribI4i.Invoke(index, x, y, z, w); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI1UIPROC(uint index, uint x); + private PFNGLVERTEXATTRIBI1UIPROC glVertexAttribI1ui; + + public void VertexAttribI1ui(uint index, uint x) + { + glVertexAttribI1ui.Invoke(index, x); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI2UIPROC(uint index, uint x, uint y); + private PFNGLVERTEXATTRIBI2UIPROC glVertexAttribI2ui; + + public void VertexAttribI2ui(uint index, uint x, uint y) + { + glVertexAttribI2ui.Invoke(index, x, y); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI3UIPROC(uint index, uint x, uint y, uint z); + private PFNGLVERTEXATTRIBI3UIPROC glVertexAttribI3ui; + + public void VertexAttribI3ui(uint index, uint x, uint y, uint z) + { + glVertexAttribI3ui.Invoke(index, x, y, z); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI4UIPROC(uint index, uint x, uint y, uint z, uint w); + private PFNGLVERTEXATTRIBI4UIPROC glVertexAttribI4ui; + + public void VertexAttribI4ui(uint index, uint x, uint y, uint z, uint w) + { + glVertexAttribI4ui.Invoke(index, x, y, z, w); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI1IVPROC(uint index, int[] v); + private PFNGLVERTEXATTRIBI1IVPROC glVertexAttribI1iv; + + public void VertexAttribI1iv(uint index, int[] v) + { + glVertexAttribI1iv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI2IVPROC(uint index, int[] v); + private PFNGLVERTEXATTRIBI2IVPROC glVertexAttribI2iv; + + public void VertexAttribI2iv(uint index, int[] v) + { + glVertexAttribI2iv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI3IVPROC(uint index, int[] v); + private PFNGLVERTEXATTRIBI3IVPROC glVertexAttribI3iv; + + public void VertexAttribI3iv(uint index, int[] v) + { + glVertexAttribI3iv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI4IVPROC(uint index, int[] v); + private PFNGLVERTEXATTRIBI4IVPROC glVertexAttribI4iv; + + public void VertexAttribI4iv(uint index, int[] v) + { + glVertexAttribI4iv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI1UIVPROC(uint index, uint[] v); + private PFNGLVERTEXATTRIBI1UIVPROC glVertexAttribI1uiv; + + public void VertexAttribI1uiv(uint index, uint[] v) + { + glVertexAttribI1uiv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI2UIVPROC(uint index, uint[] v); + private PFNGLVERTEXATTRIBI2UIVPROC glVertexAttribI2uiv; + + public void VertexAttribI2uiv(uint index, uint[] v) + { + glVertexAttribI2uiv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI3UIVPROC(uint index, uint[] v); + private PFNGLVERTEXATTRIBI3UIVPROC glVertexAttribI3uiv; + + public void VertexAttribI3uiv(uint index, uint[] v) + { + glVertexAttribI3uiv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI4UIVPROC(uint index, uint[] v); + private PFNGLVERTEXATTRIBI4UIVPROC glVertexAttribI4uiv; + + public void VertexAttribI4uiv(uint index, uint[] v) + { + glVertexAttribI4uiv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI4BVPROC(uint index, sbyte[] v); + private PFNGLVERTEXATTRIBI4BVPROC glVertexAttribI4bv; + + public void VertexAttribI4bv(uint index, sbyte[] v) + { + glVertexAttribI4bv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI4SVPROC(uint index, short[] v); + private PFNGLVERTEXATTRIBI4SVPROC glVertexAttribI4sv; + + public void VertexAttribI4sv(uint index, short[] v) + { + glVertexAttribI4sv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI4UBVPROC(uint index, byte[] v); + private PFNGLVERTEXATTRIBI4UBVPROC glVertexAttribI4ubv; + + public void VertexAttribI4ubv(uint index, byte[] v) + { + glVertexAttribI4ubv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLVERTEXATTRIBI4USVPROC(uint index, ushort[] v); + private PFNGLVERTEXATTRIBI4USVPROC glVertexAttribI4usv; + + public void VertexAttribI4usv(uint index, ushort[] v) + { + glVertexAttribI4usv.Invoke(index, v); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETUNIFORMUIVPROC(uint program, int location, out uint parameters); + private PFNGLGETUNIFORMUIVPROC glGetUniformuiv; + + public void GetUniformuiv(uint program, int location, out uint parameters) + { + glGetUniformuiv.Invoke(program, location, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDFRAGDATALOCATIONPROC(uint program, uint color, sbyte[] name); + private PFNGLBINDFRAGDATALOCATIONPROC glBindFragDataLocation; + + public void BindFragDataLocation(uint program, uint color, sbyte[] name) + { + glBindFragDataLocation.Invoke(program, color, name); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int PFNGLGETFRAGDATALOCATIONPROC(uint program, sbyte[] name); + private PFNGLGETFRAGDATALOCATIONPROC glGetFragDataLocation; + + public int GetFragDataLocation(uint program, sbyte[] name) + { + return glGetFragDataLocation.Invoke(program, name); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM1UIPROC(int location, uint v0); + private PFNGLUNIFORM1UIPROC glUniform1ui; + + public void Uniform1ui(int location, uint v0) + { + glUniform1ui.Invoke(location, v0); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM2UIPROC(int location, uint v0, uint v1); + private PFNGLUNIFORM2UIPROC glUniform2ui; + + public void Uniform2ui(int location, uint v0, uint v1) + { + glUniform2ui.Invoke(location, v0, v1); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM3UIPROC(int location, uint v0, uint v1, uint v2); + private PFNGLUNIFORM3UIPROC glUniform3ui; + + public void Uniform3ui(int location, uint v0, uint v1, uint v2) + { + glUniform3ui.Invoke(location, v0, v1, v2); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM4UIPROC(int location, uint v0, uint v1, uint v2, uint v3); + private PFNGLUNIFORM4UIPROC glUniform4ui; + + public void Uniform4ui(int location, uint v0, uint v1, uint v2, uint v3) + { + glUniform4ui.Invoke(location, v0, v1, v2, v3); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM1UIVPROC(int location, int count, uint[] value); + private PFNGLUNIFORM1UIVPROC glUniform1uiv; + + public void Uniform1uiv(int location, int count, uint[] value) + { + glUniform1uiv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM2UIVPROC(int location, int count, uint[] value); + private PFNGLUNIFORM2UIVPROC glUniform2uiv; + + public void Uniform2uiv(int location, int count, uint[] value) + { + glUniform2uiv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM3UIVPROC(int location, int count, uint[] value); + private PFNGLUNIFORM3UIVPROC glUniform3uiv; + + public void Uniform3uiv(int location, int count, uint[] value) + { + glUniform3uiv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORM4UIVPROC(int location, int count, uint[] value); + private PFNGLUNIFORM4UIVPROC glUniform4uiv; + + public void Uniform4uiv(int location, int count, uint[] value) + { + glUniform4uiv.Invoke(location, count, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXPARAMETERIIVPROC(TextureTarget target, TextureParameterName pname, int[] parameters); + private PFNGLTEXPARAMETERIIVPROC glTexParameterIiv; + + public void TexParameterIiv(TextureTarget target, TextureParameterName pname, int[] parameters) + { + glTexParameterIiv.Invoke(target, pname, parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXPARAMETERIUIVPROC(TextureTarget target, TextureParameterName pname, uint[] parameters); + private PFNGLTEXPARAMETERIUIVPROC glTexParameterIuiv; + + public void TexParameterIuiv(TextureTarget target, TextureParameterName pname, uint[] parameters) + { + glTexParameterIuiv.Invoke(target, pname, parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETTEXPARAMETERIIVPROC(TextureTarget target, GetTextureParameter pname, out int parameters); + private PFNGLGETTEXPARAMETERIIVPROC glGetTexParameterIiv; + + public void GetTexParameterIiv(TextureTarget target, GetTextureParameter pname, out int parameters) + { + glGetTexParameterIiv.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETTEXPARAMETERIUIVPROC(TextureTarget target, GetTextureParameter pname, out uint parameters); + private PFNGLGETTEXPARAMETERIUIVPROC glGetTexParameterIuiv; + + public void GetTexParameterIuiv(TextureTarget target, GetTextureParameter pname, out uint parameters) + { + glGetTexParameterIuiv.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLEARBUFFERIVPROC(Buffer buffer, int drawbuffer, int[] value); + private PFNGLCLEARBUFFERIVPROC glClearBufferiv; + + public void ClearBufferiv(Buffer buffer, int drawbuffer, int[] value) + { + glClearBufferiv.Invoke(buffer, drawbuffer, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLEARBUFFERUIVPROC(Buffer buffer, int drawbuffer, uint[] value); + private PFNGLCLEARBUFFERUIVPROC glClearBufferuiv; + + public void ClearBufferuiv(Buffer buffer, int drawbuffer, uint[] value) + { + glClearBufferuiv.Invoke(buffer, drawbuffer, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLEARBUFFERFVPROC(Buffer buffer, int drawbuffer, float[] value); + private PFNGLCLEARBUFFERFVPROC glClearBufferfv; + + public void ClearBufferfv(Buffer buffer, int drawbuffer, float[] value) + { + glClearBufferfv.Invoke(buffer, drawbuffer, value); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCLEARBUFFERFIPROC(Buffer buffer, int drawbuffer, float depth, int stencil); + private PFNGLCLEARBUFFERFIPROC glClearBufferfi; + + public void ClearBufferfi(Buffer buffer, int drawbuffer, float depth, int stencil) + { + glClearBufferfi.Invoke(buffer, drawbuffer, depth, stencil); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr PFNGLGETSTRINGIPROC(StringName name, uint index); + private PFNGLGETSTRINGIPROC glGetStringi; + + public IntPtr GetStringi(StringName name, uint index) + { + return glGetStringi.Invoke(name, index); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISRENDERBUFFERPROC(uint renderbuffer); + private PFNGLISRENDERBUFFERPROC glIsRenderbuffer; + + public bool IsRenderbuffer(uint renderbuffer) + { + return glIsRenderbuffer.Invoke(renderbuffer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDRENDERBUFFERPROC(RenderbufferTarget target, uint renderbuffer); + private PFNGLBINDRENDERBUFFERPROC glBindRenderbuffer; + + public void BindRenderbuffer(RenderbufferTarget target, uint renderbuffer) + { + glBindRenderbuffer.Invoke(target, renderbuffer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETERENDERBUFFERSPROC(int n, uint[] renderbuffers); + private PFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers; + + public void DeleteRenderbuffers(int n, uint[] renderbuffers) + { + glDeleteRenderbuffers.Invoke(n, renderbuffers); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGENRENDERBUFFERSPROC(int n, out uint renderbuffers); + private PFNGLGENRENDERBUFFERSPROC glGenRenderbuffers; + + public void GenRenderbuffers(int n, out uint renderbuffers) + { + glGenRenderbuffers.Invoke(n, out renderbuffers); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLRENDERBUFFERSTORAGEPROC(RenderbufferTarget target, InternalFormat internalformat, int width, int height); + private PFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage; + + public void RenderbufferStorage(RenderbufferTarget target, InternalFormat internalformat, int width, int height) + { + glRenderbufferStorage.Invoke(target, internalformat, width, height); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETRENDERBUFFERPARAMETERIVPROC(RenderbufferTarget target, RenderbufferParameterName pname, out int parameters); + private PFNGLGETRENDERBUFFERPARAMETERIVPROC glGetRenderbufferParameteriv; + + public void GetRenderbufferParameteriv(RenderbufferTarget target, RenderbufferParameterName pname, out int parameters) + { + glGetRenderbufferParameteriv.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISFRAMEBUFFERPROC(uint framebuffer); + private PFNGLISFRAMEBUFFERPROC glIsFramebuffer; + + public bool IsFramebuffer(uint framebuffer) + { + return glIsFramebuffer.Invoke(framebuffer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDFRAMEBUFFERPROC(FramebufferTarget target, uint framebuffer); + private PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer; + + public void BindFramebuffer(FramebufferTarget target, uint framebuffer) + { + glBindFramebuffer.Invoke(target, framebuffer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETEFRAMEBUFFERSPROC(int n, uint[] framebuffers); + private PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers; + + public void DeleteFramebuffers(int n, uint[] framebuffers) + { + glDeleteFramebuffers.Invoke(n, framebuffers); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGENFRAMEBUFFERSPROC(int n, out uint framebuffers); + private PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers; + + public void GenFramebuffers(int n, out uint framebuffers) + { + glGenFramebuffers.Invoke(n, out framebuffers); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate FramebufferStatus PFNGLCHECKFRAMEBUFFERSTATUSPROC(FramebufferTarget target); + private PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus; + + public FramebufferStatus CheckFramebufferStatus(FramebufferTarget target) + { + return glCheckFramebufferStatus.Invoke(target); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFRAMEBUFFERTEXTURE1DPROC(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget textarget, uint texture, int level); + private PFNGLFRAMEBUFFERTEXTURE1DPROC glFramebufferTexture1D; + + public void FramebufferTexture1D(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget textarget, uint texture, int level) + { + glFramebufferTexture1D.Invoke(target, attachment, textarget, texture, level); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFRAMEBUFFERTEXTURE2DPROC(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget textarget, uint texture, int level); + private PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D; + + public void FramebufferTexture2D(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget textarget, uint texture, int level) + { + glFramebufferTexture2D.Invoke(target, attachment, textarget, texture, level); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFRAMEBUFFERTEXTURE3DPROC(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget textarget, uint texture, int level, int zoffset); + private PFNGLFRAMEBUFFERTEXTURE3DPROC glFramebufferTexture3D; + + public void FramebufferTexture3D(FramebufferTarget target, FramebufferAttachment attachment, TextureTarget textarget, uint texture, int level, int zoffset) + { + glFramebufferTexture3D.Invoke(target, attachment, textarget, texture, level, zoffset); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFRAMEBUFFERRENDERBUFFERPROC(FramebufferTarget target, FramebufferAttachment attachment, RenderbufferTarget renderbuffertarget, uint renderbuffer); + private PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer; + + public void FramebufferRenderbuffer(FramebufferTarget target, FramebufferAttachment attachment, RenderbufferTarget renderbuffertarget, uint renderbuffer) + { + glFramebufferRenderbuffer.Invoke(target, attachment, renderbuffertarget, renderbuffer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC(FramebufferTarget target, FramebufferAttachment attachment, FramebufferAttachmentParameterName pname, out int parameters); + private PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv; + + public void GetFramebufferAttachmentParameteriv(FramebufferTarget target, FramebufferAttachment attachment, FramebufferAttachmentParameterName pname, out int parameters) + { + glGetFramebufferAttachmentParameteriv.Invoke(target, attachment, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGENERATEMIPMAPPROC(TextureTarget target); + private PFNGLGENERATEMIPMAPPROC glGenerateMipmap; + + public void GenerateMipmap(TextureTarget target) + { + glGenerateMipmap.Invoke(target); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBLITFRAMEBUFFERPROC(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFramebufferFilter filter); + private PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer; + + public void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, ClearBufferMask mask, BlitFramebufferFilter filter) + { + glBlitFramebuffer.Invoke(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC(RenderbufferTarget target, int samples, InternalFormat internalformat, int width, int height); + private PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample; + + public void RenderbufferStorageMultisample(RenderbufferTarget target, int samples, InternalFormat internalformat, int width, int height) + { + glRenderbufferStorageMultisample.Invoke(target, samples, internalformat, width, height); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFRAMEBUFFERTEXTURELAYERPROC(FramebufferTarget target, FramebufferAttachment attachment, uint texture, int level, int layer); + private PFNGLFRAMEBUFFERTEXTURELAYERPROC glFramebufferTextureLayer; + + public void FramebufferTextureLayer(FramebufferTarget target, FramebufferAttachment attachment, uint texture, int level, int layer) + { + glFramebufferTextureLayer.Invoke(target, attachment, texture, level, layer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr PFNGLMAPBUFFERRANGEPROC(BufferTargetARB target, IntPtr offset, IntPtr length, MapBufferAccessMask access); + private PFNGLMAPBUFFERRANGEPROC glMapBufferRange; + + public IntPtr MapBufferRange(BufferTargetARB target, IntPtr offset, IntPtr length, MapBufferAccessMask access) + { + return glMapBufferRange.Invoke(target, offset, length, access); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFLUSHMAPPEDBUFFERRANGEPROC(BufferTargetARB target, IntPtr offset, IntPtr length); + private PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange; + + public void FlushMappedBufferRange(BufferTargetARB target, IntPtr offset, IntPtr length) + { + glFlushMappedBufferRange.Invoke(target, offset, length); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLBINDVERTEXARRAYPROC(uint array); + private PFNGLBINDVERTEXARRAYPROC glBindVertexArray; + + public void BindVertexArray(uint array) + { + glBindVertexArray.Invoke(array); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETEVERTEXARRAYSPROC(int n, uint[] arrays); + private PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays; + + public void DeleteVertexArrays(int n, uint[] arrays) + { + glDeleteVertexArrays.Invoke(n, arrays); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGENVERTEXARRAYSPROC(int n, uint[] arrays); + private PFNGLGENVERTEXARRAYSPROC glGenVertexArrays; + + public void GenVertexArrays(int n, uint[] arrays) + { + glGenVertexArrays.Invoke(n, arrays); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISVERTEXARRAYPROC(uint array); + private PFNGLISVERTEXARRAYPROC glIsVertexArray; + + public bool IsVertexArray(uint array) + { + return glIsVertexArray.Invoke(array); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWARRAYSINSTANCEDPROC(PrimitiveType mode, int first, int count, int instancecount); + private PFNGLDRAWARRAYSINSTANCEDPROC glDrawArraysInstanced; + + public void DrawArraysInstanced(PrimitiveType mode, int first, int count, int instancecount) + { + glDrawArraysInstanced.Invoke(mode, first, count, instancecount); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWELEMENTSINSTANCEDPROC(PrimitiveType mode, int count, DrawElementsType type, IntPtr indices, int instancecount); + private PFNGLDRAWELEMENTSINSTANCEDPROC glDrawElementsInstanced; + + public void DrawElementsInstanced(PrimitiveType mode, int count, DrawElementsType type, IntPtr indices, int instancecount) + { + glDrawElementsInstanced.Invoke(mode, count, type, indices, instancecount); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXBUFFERPROC(TextureTarget target, InternalFormat internalformat, uint buffer); + private PFNGLTEXBUFFERPROC glTexBuffer; + + public void TexBuffer(TextureTarget target, InternalFormat internalformat, uint buffer) + { + glTexBuffer.Invoke(target, internalformat, buffer); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPRIMITIVERESTARTINDEXPROC(uint index); + private PFNGLPRIMITIVERESTARTINDEXPROC glPrimitiveRestartIndex; + + public void PrimitiveRestartIndex(uint index) + { + glPrimitiveRestartIndex.Invoke(index); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLCOPYBUFFERSUBDATAPROC(CopyBufferSubDataTarget readTarget, CopyBufferSubDataTarget writeTarget, IntPtr readOffset, IntPtr writeOffset, IntPtr size); + private PFNGLCOPYBUFFERSUBDATAPROC glCopyBufferSubData; + + public void CopyBufferSubData(CopyBufferSubDataTarget readTarget, CopyBufferSubDataTarget writeTarget, IntPtr readOffset, IntPtr writeOffset, IntPtr size) + { + glCopyBufferSubData.Invoke(readTarget, writeTarget, readOffset, writeOffset, size); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETUNIFORMINDICESPROC(uint program, int uniformCount, sbyte uniformNames, out uint uniformIndices); + private PFNGLGETUNIFORMINDICESPROC glGetUniformIndices; + + public void GetUniformIndices(uint program, int uniformCount, sbyte uniformNames, out uint uniformIndices) + { + glGetUniformIndices.Invoke(program, uniformCount, uniformNames, out uniformIndices); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETACTIVEUNIFORMSIVPROC(uint program, int uniformCount, uint[] uniformIndices, UniformPName pname, out int parameters); + private PFNGLGETACTIVEUNIFORMSIVPROC glGetActiveUniformsiv; + + public void GetActiveUniformsiv(uint program, int uniformCount, uint[] uniformIndices, UniformPName pname, out int parameters) + { + glGetActiveUniformsiv.Invoke(program, uniformCount, uniformIndices, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETACTIVEUNIFORMNAMEPROC(uint program, uint uniformIndex, int bufSize, out int length, out sbyte uniformName); + private PFNGLGETACTIVEUNIFORMNAMEPROC glGetActiveUniformName; + + public void GetActiveUniformName(uint program, uint uniformIndex, int bufSize, out int length, out sbyte uniformName) + { + glGetActiveUniformName.Invoke(program, uniformIndex, bufSize, out length, out uniformName); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate uint PFNGLGETUNIFORMBLOCKINDEXPROC(uint program, sbyte[] uniformBlockName); + private PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex; + + public uint GetUniformBlockIndex(uint program, sbyte[] uniformBlockName) + { + return glGetUniformBlockIndex.Invoke(program, uniformBlockName); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETACTIVEUNIFORMBLOCKIVPROC(uint program, uint uniformBlockIndex, UniformBlockPName pname, out int parameters); + private PFNGLGETACTIVEUNIFORMBLOCKIVPROC glGetActiveUniformBlockiv; + + public void GetActiveUniformBlockiv(uint program, uint uniformBlockIndex, UniformBlockPName pname, out int parameters) + { + glGetActiveUniformBlockiv.Invoke(program, uniformBlockIndex, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC(uint program, uint uniformBlockIndex, int bufSize, out int length, out sbyte uniformBlockName); + private PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glGetActiveUniformBlockName; + + public void GetActiveUniformBlockName(uint program, uint uniformBlockIndex, int bufSize, out int length, out sbyte uniformBlockName) + { + glGetActiveUniformBlockName.Invoke(program, uniformBlockIndex, bufSize, out length, out uniformBlockName); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLUNIFORMBLOCKBINDINGPROC(uint program, uint uniformBlockIndex, uint uniformBlockBinding); + private PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding; + + public void UniformBlockBinding(uint program, uint uniformBlockIndex, uint uniformBlockBinding) + { + glUniformBlockBinding.Invoke(program, uniformBlockIndex, uniformBlockBinding); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWELEMENTSBASEVERTEXPROC(PrimitiveType mode, int count, DrawElementsType type, IntPtr indices, int basevertex); + private PFNGLDRAWELEMENTSBASEVERTEXPROC glDrawElementsBaseVertex; + + public void DrawElementsBaseVertex(PrimitiveType mode, int count, DrawElementsType type, IntPtr indices, int basevertex) + { + glDrawElementsBaseVertex.Invoke(mode, count, type, indices, basevertex); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC(PrimitiveType mode, uint start, uint end, int count, DrawElementsType type, IntPtr indices, int basevertex); + private PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glDrawRangeElementsBaseVertex; + + public void DrawRangeElementsBaseVertex(PrimitiveType mode, uint start, uint end, int count, DrawElementsType type, IntPtr indices, int basevertex) + { + glDrawRangeElementsBaseVertex.Invoke(mode, start, end, count, type, indices, basevertex); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC(PrimitiveType mode, int count, DrawElementsType type, IntPtr indices, int instancecount, int basevertex); + private PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glDrawElementsInstancedBaseVertex; + + public void DrawElementsInstancedBaseVertex(PrimitiveType mode, int count, DrawElementsType type, IntPtr indices, int instancecount, int basevertex) + { + glDrawElementsInstancedBaseVertex.Invoke(mode, count, type, indices, instancecount, basevertex); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC(PrimitiveType mode, int[] count, DrawElementsType type, int[] indices, int drawcount, int[] basevertex); + private PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glMultiDrawElementsBaseVertex; + + public void MultiDrawElementsBaseVertex(PrimitiveType mode, int[] count, DrawElementsType type, int[] indices, int drawcount, int[] basevertex) + { + glMultiDrawElementsBaseVertex.Invoke(mode, count, type, indices, drawcount, basevertex); + DetectGLError(); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLPROVOKINGVERTEXPROC(VertexProvokingMode mode); + private PFNGLPROVOKINGVERTEXPROC glProvokingVertex; + + public void ProvokingVertex(VertexProvokingMode mode) + { + glProvokingVertex.Invoke(mode); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr PFNGLFENCESYNCPROC(SyncCondition condition, uint flags); + private PFNGLFENCESYNCPROC glFenceSync; + + public IntPtr FenceSync(SyncCondition condition, uint flags) + { + return glFenceSync.Invoke(condition, flags); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool PFNGLISSYNCPROC(IntPtr sync); + private PFNGLISSYNCPROC glIsSync; + + public bool IsSync(IntPtr sync) + { + return glIsSync.Invoke(sync); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLDELETESYNCPROC(IntPtr sync); + private PFNGLDELETESYNCPROC glDeleteSync; + + public void DeleteSync(IntPtr sync) + { + glDeleteSync.Invoke(sync); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate SyncStatus PFNGLCLIENTWAITSYNCPROC(IntPtr sync, SyncObjectMask flags, ulong timeout); + private PFNGLCLIENTWAITSYNCPROC glClientWaitSync; + + public SyncStatus ClientWaitSync(IntPtr sync, SyncObjectMask flags, ulong timeout) + { + return glClientWaitSync.Invoke(sync, flags, timeout); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLWAITSYNCPROC(IntPtr sync, uint flags, ulong timeout); + private PFNGLWAITSYNCPROC glWaitSync; + + public void WaitSync(IntPtr sync, uint flags, ulong timeout) + { + glWaitSync.Invoke(sync, flags, timeout); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETINTEGER64VPROC(GetPName pname, out long data); + private PFNGLGETINTEGER64VPROC glGetInteger64v; + + public void GetInteger64v(GetPName pname, out long data) + { + glGetInteger64v.Invoke(pname, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETSYNCIVPROC(IntPtr sync, SyncParameterName pname, int bufSize, out int length, out int values); + private PFNGLGETSYNCIVPROC glGetSynciv; + + public void GetSynciv(IntPtr sync, SyncParameterName pname, int bufSize, out int length, out int values) + { + glGetSynciv.Invoke(sync, pname, bufSize, out length, out values); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETINTEGER64I_VPROC(TypeEnum target, uint index, out long data); + private PFNGLGETINTEGER64I_VPROC glGetInteger64i_v; + + public void GetInteger64i_v(TypeEnum target, uint index, out long data) + { + glGetInteger64i_v.Invoke(target, index, out data); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETBUFFERPARAMETERI64VPROC(BufferTargetARB target, int pname, out long parameters); + private PFNGLGETBUFFERPARAMETERI64VPROC glGetBufferParameteri64v; + + public void GetBufferParameteri64v(BufferTargetARB target, int pname, out long parameters) + { + glGetBufferParameteri64v.Invoke(target, pname, out parameters); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLFRAMEBUFFERTEXTUREPROC(FramebufferTarget target, FramebufferAttachment attachment, uint texture, int level); + private PFNGLFRAMEBUFFERTEXTUREPROC glFramebufferTexture; + + public void FramebufferTexture(FramebufferTarget target, FramebufferAttachment attachment, uint texture, int level) + { + glFramebufferTexture.Invoke(target, attachment, texture, level); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXIMAGE2DMULTISAMPLEPROC(TextureTarget target, int samples, InternalFormat internalformat, int width, int height, bool fixedsamplelocations); + private PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample; + + public void TexImage2DMultisample(TextureTarget target, int samples, InternalFormat internalformat, int width, int height, bool fixedsamplelocations) + { + glTexImage2DMultisample.Invoke(target, samples, internalformat, width, height, fixedsamplelocations); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLTEXIMAGE3DMULTISAMPLEPROC(TextureTarget target, int samples, InternalFormat internalformat, int width, int height, int depth, bool fixedsamplelocations); + private PFNGLTEXIMAGE3DMULTISAMPLEPROC glTexImage3DMultisample; + + public void TexImage3DMultisample(TextureTarget target, int samples, InternalFormat internalformat, int width, int height, int depth, bool fixedsamplelocations) + { + glTexImage3DMultisample.Invoke(target, samples, internalformat, width, height, depth, fixedsamplelocations); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLGETMULTISAMPLEFVPROC(int pname, uint index, out float val); + private PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv; + + public void GetMultisamplefv(int pname, uint index, out float val) + { + glGetMultisamplefv.Invoke(pname, index, out val); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void PFNGLSAMPLEMASKIPROC(uint maskNumber, uint mask); + private PFNGLSAMPLEMASKIPROC glSampleMaski; + + public void SampleMaski(uint maskNumber, uint mask) + { + glSampleMaski.Invoke(maskNumber, mask); + } + + public GLContext(IntPtr windowHandle) + { + GetProcAddressHandler loader = SDL.SDL_GL_GetProcAddress; + Handle = SDL.SDL_GL_CreateContext(windowHandle); + if (Handle == null) { + throw new FrameworkSDLException(); + } + + glCullFace = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCullFace")); + glFrontFace = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFrontFace")); + glHint = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glHint")); + glLineWidth = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glLineWidth")); + glPointSize = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPointSize")); + glPolygonMode = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPolygonMode")); + glScissor = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glScissor")); + glTexParameterf = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexParameterf")); + glTexParameterfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexParameterfv")); + glTexParameteri = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexParameteri")); + glTexParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexParameteriv")); + glTexImage1D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexImage1D")); + glTexImage2D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexImage2D")); + glDrawBuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawBuffer")); + glClear = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClear")); + glClearColor = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClearColor")); + glClearStencil = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClearStencil")); + glClearDepth = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClearDepth")); + glStencilMask = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glStencilMask")); + glColorMask = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glColorMask")); + glDepthMask = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDepthMask")); + glDisable = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDisable")); + glEnable = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glEnable")); + glFinish = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFinish")); + glFlush = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFlush")); + glBlendFunc = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBlendFunc")); + glLogicOp = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glLogicOp")); + glStencilFunc = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glStencilFunc")); + glStencilOp = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glStencilOp")); + glDepthFunc = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDepthFunc")); + glPixelStoref = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPixelStoref")); + glPixelStorei = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPixelStorei")); + glReadBuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glReadBuffer")); + glReadPixels = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glReadPixels")); + glGetBooleanv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetBooleanv")); + glGetDoublev = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetDoublev")); + glGetError = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetError")); + glGetFloatv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetFloatv")); + glGetIntegerv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetIntegerv")); + glGetString = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetString")); + glGetTexImage = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetTexImage")); + glGetTexParameterfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetTexParameterfv")); + glGetTexParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetTexParameteriv")); + glGetTexLevelParameterfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetTexLevelParameterfv")); + glGetTexLevelParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetTexLevelParameteriv")); + glIsEnabled = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsEnabled")); + glDepthRange = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDepthRange")); + glViewport = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glViewport")); + glDrawArrays = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawArrays")); + glDrawElements = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawElements")); + glPolygonOffset = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPolygonOffset")); + glCopyTexImage1D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCopyTexImage1D")); + glCopyTexImage2D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCopyTexImage2D")); + glCopyTexSubImage1D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCopyTexSubImage1D")); + glCopyTexSubImage2D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCopyTexSubImage2D")); + glTexSubImage1D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexSubImage1D")); + glTexSubImage2D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexSubImage2D")); + glBindTexture = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindTexture")); + glDeleteTextures = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteTextures")); + glGenTextures = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGenTextures")); + glIsTexture = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsTexture")); + glDrawRangeElements = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawRangeElements")); + glTexImage3D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexImage3D")); + glTexSubImage3D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexSubImage3D")); + glCopyTexSubImage3D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCopyTexSubImage3D")); + glActiveTexture = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glActiveTexture")); + glSampleCoverage = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glSampleCoverage")); + glCompressedTexImage3D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCompressedTexImage3D")); + glCompressedTexImage2D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCompressedTexImage2D")); + glCompressedTexImage1D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCompressedTexImage1D")); + glCompressedTexSubImage3D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCompressedTexSubImage3D")); + glCompressedTexSubImage2D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCompressedTexSubImage2D")); + glCompressedTexSubImage1D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCompressedTexSubImage1D")); + glGetCompressedTexImage = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetCompressedTexImage")); + glBlendFuncSeparate = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBlendFuncSeparate")); + glMultiDrawArrays = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glMultiDrawArrays")); + glMultiDrawElements = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glMultiDrawElements")); + glPointParameterf = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPointParameterf")); + glPointParameterfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPointParameterfv")); + glPointParameteri = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPointParameteri")); + glPointParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPointParameteriv")); + glVertexAttribP4uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribP4uiv")); + glVertexAttribP4ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribP4ui")); + glVertexAttribP3uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribP3uiv")); + glVertexAttribP3ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribP3ui")); + glVertexAttribP2uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribP2uiv")); + glVertexAttribP2ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribP2ui")); + glVertexAttribP1uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribP1uiv")); + glVertexAttribP1ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribP1ui")); + glVertexAttribDivisor = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribDivisor")); + glGetQueryObjectui64v = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetQueryObjectui64v")); + glGetQueryObjecti64v = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetQueryObjecti64v")); + glQueryCounter = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glQueryCounter")); + glGetSamplerParameterIuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetSamplerParameterIuiv")); + glGetSamplerParameterfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetSamplerParameterfv")); + glGetSamplerParameterIiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetSamplerParameterIiv")); + glGetSamplerParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetSamplerParameteriv")); + glSamplerParameterIuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glSamplerParameterIuiv")); + glSamplerParameterIiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glSamplerParameterIiv")); + glSamplerParameterfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glSamplerParameterfv")); + glSamplerParameterf = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glSamplerParameterf")); + glSamplerParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glSamplerParameteriv")); + glSamplerParameteri = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glSamplerParameteri")); + glBindSampler = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindSampler")); + glIsSampler = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsSampler")); + glDeleteSamplers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteSamplers")); + glGenSamplers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGenSamplers")); + glGetFragDataIndex = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetFragDataIndex")); + glBindFragDataLocationIndexed = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindFragDataLocationIndexed")); + glBlendColor = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBlendColor")); + glBlendEquation = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBlendEquation")); + glGenQueries = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGenQueries")); + glDeleteQueries = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteQueries")); + glIsQuery = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsQuery")); + glBeginQuery = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBeginQuery")); + glEndQuery = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glEndQuery")); + glGetQueryiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetQueryiv")); + glGetQueryObjectiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetQueryObjectiv")); + glGetQueryObjectuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetQueryObjectuiv")); + glBindBuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindBuffer")); + glDeleteBuffers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteBuffers")); + glGenBuffers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGenBuffers")); + glIsBuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsBuffer")); + glBufferData = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBufferData")); + glBufferSubData = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBufferSubData")); + glGetBufferSubData = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetBufferSubData")); + glMapBuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glMapBuffer")); + glUnmapBuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUnmapBuffer")); + glGetBufferParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetBufferParameteriv")); + glGetBufferPointerv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetBufferPointerv")); + glBlendEquationSeparate = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBlendEquationSeparate")); + glDrawBuffers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawBuffers")); + glStencilOpSeparate = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glStencilOpSeparate")); + glStencilFuncSeparate = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glStencilFuncSeparate")); + glStencilMaskSeparate = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glStencilMaskSeparate")); + glAttachShader = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glAttachShader")); + glBindAttribLocation = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindAttribLocation")); + glCompileShader = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCompileShader")); + glCreateProgram = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCreateProgram")); + glCreateShader = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCreateShader")); + glDeleteProgram = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteProgram")); + glDeleteShader = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteShader")); + glDetachShader = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDetachShader")); + glDisableVertexAttribArray = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDisableVertexAttribArray")); + glEnableVertexAttribArray = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glEnableVertexAttribArray")); + glGetActiveAttrib = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetActiveAttrib")); + glGetActiveUniform = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetActiveUniform")); + glGetAttachedShaders = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetAttachedShaders")); + glGetAttribLocation = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetAttribLocation")); + glGetProgramiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetProgramiv")); + glGetProgramInfoLog = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetProgramInfoLog")); + glGetShaderiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetShaderiv")); + glGetShaderInfoLog = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetShaderInfoLog")); + glGetShaderSource = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetShaderSource")); + glGetUniformLocation = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetUniformLocation")); + glGetUniformfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetUniformfv")); + glGetUniformiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetUniformiv")); + glGetVertexAttribdv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetVertexAttribdv")); + glGetVertexAttribfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetVertexAttribfv")); + glGetVertexAttribiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetVertexAttribiv")); + glGetVertexAttribPointerv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetVertexAttribPointerv")); + glIsProgram = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsProgram")); + glIsShader = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsShader")); + glLinkProgram = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glLinkProgram")); + glShaderSource = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glShaderSource")); + glUseProgram = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUseProgram")); + glUniform1f = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform1f")); + glUniform2f = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform2f")); + glUniform3f = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform3f")); + glUniform4f = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform4f")); + glUniform1i = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform1i")); + glUniform2i = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform2i")); + glUniform3i = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform3i")); + glUniform4i = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform4i")); + glUniform1fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform1fv")); + glUniform2fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform2fv")); + glUniform3fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform3fv")); + glUniform4fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform4fv")); + glUniform1iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform1iv")); + glUniform2iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform2iv")); + glUniform3iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform3iv")); + glUniform4iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform4iv")); + glUniformMatrix2fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix2fv")); + glUniformMatrix3fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix3fv")); + glUniformMatrix4fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix4fv")); + glValidateProgram = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glValidateProgram")); + glVertexAttrib1d = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib1d")); + glVertexAttrib1dv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib1dv")); + glVertexAttrib1f = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib1f")); + glVertexAttrib1fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib1fv")); + glVertexAttrib1s = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib1s")); + glVertexAttrib1sv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib1sv")); + glVertexAttrib2d = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib2d")); + glVertexAttrib2dv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib2dv")); + glVertexAttrib2f = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib2f")); + glVertexAttrib2fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib2fv")); + glVertexAttrib2s = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib2s")); + glVertexAttrib2sv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib2sv")); + glVertexAttrib3d = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib3d")); + glVertexAttrib3dv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib3dv")); + glVertexAttrib3f = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib3f")); + glVertexAttrib3fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib3fv")); + glVertexAttrib3s = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib3s")); + glVertexAttrib3sv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib3sv")); + glVertexAttrib4Nbv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4Nbv")); + glVertexAttrib4Niv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4Niv")); + glVertexAttrib4Nsv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4Nsv")); + glVertexAttrib4Nub = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4Nub")); + glVertexAttrib4Nubv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4Nubv")); + glVertexAttrib4Nuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4Nuiv")); + glVertexAttrib4Nusv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4Nusv")); + glVertexAttrib4bv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4bv")); + glVertexAttrib4d = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4d")); + glVertexAttrib4dv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4dv")); + glVertexAttrib4f = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4f")); + glVertexAttrib4fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4fv")); + glVertexAttrib4iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4iv")); + glVertexAttrib4s = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4s")); + glVertexAttrib4sv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4sv")); + glVertexAttrib4ubv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4ubv")); + glVertexAttrib4uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4uiv")); + glVertexAttrib4usv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttrib4usv")); + glVertexAttribPointer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribPointer")); + glUniformMatrix2x3fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix2x3fv")); + glUniformMatrix3x2fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix3x2fv")); + glUniformMatrix2x4fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix2x4fv")); + glUniformMatrix4x2fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix4x2fv")); + glUniformMatrix3x4fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix3x4fv")); + glUniformMatrix4x3fv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformMatrix4x3fv")); + glColorMaski = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glColorMaski")); + glGetBooleani_v = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetBooleani_v")); + glGetIntegeri_v = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetIntegeri_v")); + glEnablei = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glEnablei")); + glDisablei = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDisablei")); + glIsEnabledi = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsEnabledi")); + glBeginTransformFeedback = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBeginTransformFeedback")); + glEndTransformFeedback = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glEndTransformFeedback")); + glBindBufferRange = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindBufferRange")); + glBindBufferBase = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindBufferBase")); + glTransformFeedbackVaryings = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTransformFeedbackVaryings")); + glGetTransformFeedbackVarying = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetTransformFeedbackVarying")); + glClampColor = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClampColor")); + glBeginConditionalRender = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBeginConditionalRender")); + glEndConditionalRender = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glEndConditionalRender")); + glVertexAttribIPointer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribIPointer")); + glGetVertexAttribIiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetVertexAttribIiv")); + glGetVertexAttribIuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetVertexAttribIuiv")); + glVertexAttribI1i = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI1i")); + glVertexAttribI2i = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI2i")); + glVertexAttribI3i = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI3i")); + glVertexAttribI4i = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI4i")); + glVertexAttribI1ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI1ui")); + glVertexAttribI2ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI2ui")); + glVertexAttribI3ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI3ui")); + glVertexAttribI4ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI4ui")); + glVertexAttribI1iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI1iv")); + glVertexAttribI2iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI2iv")); + glVertexAttribI3iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI3iv")); + glVertexAttribI4iv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI4iv")); + glVertexAttribI1uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI1uiv")); + glVertexAttribI2uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI2uiv")); + glVertexAttribI3uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI3uiv")); + glVertexAttribI4uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI4uiv")); + glVertexAttribI4bv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI4bv")); + glVertexAttribI4sv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI4sv")); + glVertexAttribI4ubv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI4ubv")); + glVertexAttribI4usv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glVertexAttribI4usv")); + glGetUniformuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetUniformuiv")); + glBindFragDataLocation = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindFragDataLocation")); + glGetFragDataLocation = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetFragDataLocation")); + glUniform1ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform1ui")); + glUniform2ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform2ui")); + glUniform3ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform3ui")); + glUniform4ui = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform4ui")); + glUniform1uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform1uiv")); + glUniform2uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform2uiv")); + glUniform3uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform3uiv")); + glUniform4uiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniform4uiv")); + glTexParameterIiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexParameterIiv")); + glTexParameterIuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexParameterIuiv")); + glGetTexParameterIiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetTexParameterIiv")); + glGetTexParameterIuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetTexParameterIuiv")); + glClearBufferiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClearBufferiv")); + glClearBufferuiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClearBufferuiv")); + glClearBufferfv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClearBufferfv")); + glClearBufferfi = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClearBufferfi")); + glGetStringi = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetStringi")); + glIsRenderbuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsRenderbuffer")); + glBindRenderbuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindRenderbuffer")); + glDeleteRenderbuffers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteRenderbuffers")); + glGenRenderbuffers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGenRenderbuffers")); + glRenderbufferStorage = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glRenderbufferStorage")); + glGetRenderbufferParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetRenderbufferParameteriv")); + glIsFramebuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsFramebuffer")); + glBindFramebuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindFramebuffer")); + glDeleteFramebuffers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteFramebuffers")); + glGenFramebuffers = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGenFramebuffers")); + glCheckFramebufferStatus = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCheckFramebufferStatus")); + glFramebufferTexture1D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFramebufferTexture1D")); + glFramebufferTexture2D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFramebufferTexture2D")); + glFramebufferTexture3D = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFramebufferTexture3D")); + glFramebufferRenderbuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFramebufferRenderbuffer")); + glGetFramebufferAttachmentParameteriv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetFramebufferAttachmentParameteriv")); + glGenerateMipmap = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGenerateMipmap")); + glBlitFramebuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBlitFramebuffer")); + glRenderbufferStorageMultisample = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glRenderbufferStorageMultisample")); + glFramebufferTextureLayer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFramebufferTextureLayer")); + glMapBufferRange = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glMapBufferRange")); + glFlushMappedBufferRange = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFlushMappedBufferRange")); + glBindVertexArray = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glBindVertexArray")); + glDeleteVertexArrays = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteVertexArrays")); + glGenVertexArrays = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGenVertexArrays")); + glIsVertexArray = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsVertexArray")); + glDrawArraysInstanced = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawArraysInstanced")); + glDrawElementsInstanced = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawElementsInstanced")); + glTexBuffer = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexBuffer")); + glPrimitiveRestartIndex = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glPrimitiveRestartIndex")); + glCopyBufferSubData = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glCopyBufferSubData")); + glGetUniformIndices = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetUniformIndices")); + glGetActiveUniformsiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetActiveUniformsiv")); + glGetActiveUniformName = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetActiveUniformName")); + glGetUniformBlockIndex = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetUniformBlockIndex")); + glGetActiveUniformBlockiv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetActiveUniformBlockiv")); + glGetActiveUniformBlockName = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetActiveUniformBlockName")); + glUniformBlockBinding = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glUniformBlockBinding")); + glDrawElementsBaseVertex = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawElementsBaseVertex")); + glDrawRangeElementsBaseVertex = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawRangeElementsBaseVertex")); + glDrawElementsInstancedBaseVertex = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDrawElementsInstancedBaseVertex")); + glMultiDrawElementsBaseVertex = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glMultiDrawElementsBaseVertex")); + glProvokingVertex = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glProvokingVertex")); + glFenceSync = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFenceSync")); + glIsSync = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glIsSync")); + glDeleteSync = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glDeleteSync")); + glClientWaitSync = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glClientWaitSync")); + glWaitSync = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glWaitSync")); + glGetInteger64v = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetInteger64v")); + glGetSynciv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetSynciv")); + glGetInteger64i_v = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetInteger64i_v")); + glGetBufferParameteri64v = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetBufferParameteri64v")); + glFramebufferTexture = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glFramebufferTexture")); + glTexImage2DMultisample = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexImage2DMultisample")); + glTexImage3DMultisample = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glTexImage3DMultisample")); + glGetMultisamplefv = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glGetMultisamplefv")); + glSampleMaski = Marshal.GetDelegateForFunctionPointer(loader.Invoke("glSampleMaski")); + } + + /// + /// Checks for any issues in this OpenGL Context and throws an exception if it detects one. + /// May throw OpenGLException. + /// + private void DetectGLError() { + OpenGL.ErrorCode code = GetError(); + if (code != OpenGL.ErrorCode.NoError) { + throw new OpenGLErrorException(code); + } + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + } + SDL.SDL_GL_DeleteContext(Handle); + disposed = true; + } + } + + ~GLContext() + { + Dispose(disposing: false); + } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/OpenGL/OpenGL.cs b/src/SlatedGameToolkit.Framework/Graphics/OpenGL/OpenGL.cs new file mode 100644 index 0000000..e30d441 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Graphics/OpenGL/OpenGL.cs @@ -0,0 +1,3885 @@ +using System; +using System.Runtime.InteropServices; +using System.Security; +using System.Diagnostics.CodeAnalysis; + +namespace SlatedGameToolkit.Framework.Graphics.OpenGL +{ + public delegate IntPtr GetProcAddressHandler(string funcName); + public delegate void DebugProc(int source, int type, uint id, int severity, IntPtr length, byte[] message, IntPtr userParam); + public delegate void DebugProcAMD(uint id, int category, int severity, IntPtr length, byte[] message, IntPtr userParam); + public delegate void VulkanDebugProcNV(); + + + [Flags] + public enum AttribMask : uint + { + CurrentBit = 0x00000001, + PointBit = 0x00000002, + LineBit = 0x00000004, + PolygonBit = 0x00000008, + PolygonStippleBit = 0x00000010, + PixelModeBit = 0x00000020, + LightingBit = 0x00000040, + FogBit = 0x00000080, + DepthBufferBit = 0x00000100, + AccumBufferBit = 0x00000200, + StencilBufferBit = 0x00000400, + ViewportBit = 0x00000800, + TransformBit = 0x00001000, + EnableBit = 0x00002000, + ColorBufferBit = 0x00004000, + HintBit = 0x00008000, + EvalBit = 0x00010000, + ListBit = 0x00020000, + TextureBit = 0x00040000, + ScissorBit = 0x00080000, + MultisampleBit = 0x20000000, + MultisampleBitARB = 0x20000000, + MultisampleBitEXT = 0x20000000, + MultisampleBit3DFX = 0x20000000, + AllAttribBits = 0xFFFFFFFF + } + + [Flags] + public enum BufferStorageMask : uint + { + DynamicStorageBit = 0x0100, + DynamicStorageBitEXT = 0x0100, + ClientStorageBit = 0x0200, + ClientStorageBitEXT = 0x0200, + SparseStorageBitARB = 0x0400, + LgpuSeparateStorageBitNvx = 0x0800, + PerGpuStorageBitNV = 0x0800, + ExternalStorageBitNvx = 0x2000 + } + + [Flags] + public enum ClearBufferMask : uint + { + ColorBufferBit = 0x00004000, + DepthBufferBit = 0x00000100, + AccumBufferBit = 0x00000200, + StencilBufferBit = 0x00000400, + + } + + [Flags] + public enum ClientAttribMask : uint + { + ClientPixelStoreBit = 0x00000001, + ClientVertexArrayBit = 0x00000002, + ClientAllAttribBits = 0xFFFFFFFF + } + + [Flags] + public enum ContextFlagMask : uint + { + ContextFlagForwardCompatibleBit = 0x00000001, + ContextFlagDebugBit = 0x00000002, + ContextFlagDebugBitKhr = 0x00000002, + ContextFlagRobustAccessBit = 0x00000004, + ContextFlagRobustAccessBitARB = 0x00000004, + ContextFlagNoErrorBit = 0x00000008, + ContextFlagNoErrorBitKhr = 0x00000008, + ContextFlagProtectedContentBitEXT = 0x00000010 + } + + [Flags] + public enum ContextProfileMask : uint + { + ContextCoreProfileBit = 0x00000001, + ContextCompatibilityProfileBit = 0x00000002 + } + + [Flags] + public enum MapBufferAccessMask : uint + { + MapReadBit = 0x0001, + MapReadBitEXT = 0x0001, + MapWriteBit = 0x0002, + MapWriteBitEXT = 0x0002, + MapInvalidateRangeBit = 0x0004, + MapInvalidateRangeBitEXT = 0x0004, + MapInvalidateBufferBit = 0x0008, + MapInvalidateBufferBitEXT = 0x0008, + MapFlushExplicitBit = 0x0010, + MapFlushExplicitBitEXT = 0x0010, + MapUnsynchronizedBit = 0x0020, + MapUnsynchronizedBitEXT = 0x0020, + MapPersistentBit = 0x0040, + MapPersistentBitEXT = 0x0040, + MapCoherentBit = 0x0080, + MapCoherentBitEXT = 0x0080 + } + + [Flags] + public enum MemoryBarrierMask : uint + { + VertexAttribArrayBarrierBit = 0x00000001, + VertexAttribArrayBarrierBitEXT = 0x00000001, + ElementArrayBarrierBit = 0x00000002, + ElementArrayBarrierBitEXT = 0x00000002, + UniformBarrierBit = 0x00000004, + UniformBarrierBitEXT = 0x00000004, + TextureFetchBarrierBit = 0x00000008, + TextureFetchBarrierBitEXT = 0x00000008, + ShaderGlobalAccessBarrierBitNV = 0x00000010, + ShaderImageAccessBarrierBit = 0x00000020, + ShaderImageAccessBarrierBitEXT = 0x00000020, + CommandBarrierBit = 0x00000040, + CommandBarrierBitEXT = 0x00000040, + PixelBufferBarrierBit = 0x00000080, + PixelBufferBarrierBitEXT = 0x00000080, + TextureUpdateBarrierBit = 0x00000100, + TextureUpdateBarrierBitEXT = 0x00000100, + BufferUpdateBarrierBit = 0x00000200, + BufferUpdateBarrierBitEXT = 0x00000200, + FramebufferBarrierBit = 0x00000400, + FramebufferBarrierBitEXT = 0x00000400, + TransformFeedbackBarrierBit = 0x00000800, + TransformFeedbackBarrierBitEXT = 0x00000800, + AtomicCounterBarrierBit = 0x00001000, + AtomicCounterBarrierBitEXT = 0x00001000, + ShaderStorageBarrierBit = 0x00002000, + ClientMappedBufferBarrierBit = 0x00004000, + ClientMappedBufferBarrierBitEXT = 0x00004000, + QueryBufferBarrierBit = 0x00008000, + AllBarrierBits = 0xFFFFFFFF, + AllBarrierBitsEXT = 0xFFFFFFFF + } + + [Flags] + public enum OcclusionQueryEventMaskAMD : uint + { + QueryDepthPassEventBitAMD = 0x00000001, + QueryDepthFailEventBitAMD = 0x00000002, + QueryStencilFailEventBitAMD = 0x00000004, + QueryDepthBoundsFailEventBitAMD = 0x00000008, + QueryAllEventBitsAMD = 0xFFFFFFFF + } + + [Flags] + public enum SyncObjectMask : uint + { + SyncFlushCommandsBit = 0x00000001, + SyncFlushCommandsBitAPPLE = 0x00000001 + } + + [Flags] + public enum UseProgramStageMask : uint + { + VertexShaderBit = 0x00000001, + VertexShaderBitEXT = 0x00000001, + FragmentShaderBit = 0x00000002, + FragmentShaderBitEXT = 0x00000002, + GeometryShaderBit = 0x00000004, + GeometryShaderBitEXT = 0x00000004, + GeometryShaderBitOES = 0x00000004, + TessControlShaderBit = 0x00000008, + TessControlShaderBitEXT = 0x00000008, + TessControlShaderBitOES = 0x00000008, + TessEvaluationShaderBit = 0x00000010, + TessEvaluationShaderBitEXT = 0x00000010, + TessEvaluationShaderBitOES = 0x00000010, + ComputeShaderBit = 0x00000020, + MeshShaderBitNV = 0x00000040, + TaskShaderBitNV = 0x00000080, + AllShaderBits = 0xFFFFFFFF, + AllShaderBitsEXT = 0xFFFFFFFF + } + + [Flags] + public enum TextureStorageMaskAMD : uint + { + TextureStorageSparseBitAMD = 0x00000001 + } + + [Flags] + public enum FragmentShaderDestMaskATI : uint + { + RedBitATI = 0x00000001, + GreenBitATI = 0x00000002, + BlueBitATI = 0x00000004 + } + + [Flags] + public enum FragmentShaderDestModMaskATI : uint + { + TwoXBitATI = 0x00000001, + FourXBitATI = 0x00000002, + EightXBitATI = 0x00000004, + HalfBitATI = 0x00000008, + QuarterBitATI = 0x00000010, + EighthBitATI = 0x00000020, + SaturateBitATI = 0x00000040 + } + + [Flags] + public enum FragmentShaderColorModMaskATI : uint + { + CompBitATI = 0x00000002, + NegateBitATI = 0x00000004, + BiasBitATI = 0x00000008 + } + + [Flags] + public enum TraceMaskMESA : uint + { + TraceOperationsBitMESA = 0x0001, + TracePrimitivesBitMESA = 0x0002, + TraceArraysBitMESA = 0x0004, + TraceTexturesBitMESA = 0x0008, + TracePixelsBitMESA = 0x0010, + TraceErrorsBitMESA = 0x0020, + TraceAllBitsMESA = 0xFFFF + } + + [Flags] + public enum PathRenderingMaskNV : uint + { + BoldBitNV = 0x01, + ItalicBitNV = 0x02, + GlyphWidthBitNV = 0x01, + GlyphHeightBitNV = 0x02, + GlyphHorizontalBearingXBitNV = 0x04, + GlyphHorizontalBearingYBitNV = 0x08, + GlyphHorizontalBearingAdvanceBitNV = 0x10, + GlyphVerticalBearingXBitNV = 0x20, + GlyphVerticalBearingYBitNV = 0x40, + GlyphVerticalBearingAdvanceBitNV = 0x80, + GlyphHasKerningBitNV = 0x100, + FontXMinBoundsBitNV = 0x00010000, + FontYMinBoundsBitNV = 0x00020000, + FontXMaxBoundsBitNV = 0x00040000, + FontYMaxBoundsBitNV = 0x00080000, + FontUnitsPerEmBitNV = 0x00100000, + FontAscenderBitNV = 0x00200000, + FontDescenderBitNV = 0x00400000, + FontHeightBitNV = 0x00800000, + FontMaxAdvanceWidthBitNV = 0x01000000, + FontMaxAdvanceHeightBitNV = 0x02000000, + FontUnderlinePositionBitNV = 0x04000000, + FontUnderlineThicknessBitNV = 0x08000000, + FontHasKerningBitNV = 0x10000000, + FontNumGlyphIndicesBitNV = 0x20000000 + } + + [Flags] + public enum PerformanceQueryCapsMaskINTEL : uint + { + PerfquerySingleContextINTEL = 0x00000000, + PerfqueryGlobalContextINTEL = 0x00000001 + } + + [Flags] + public enum VertexHintsMaskPGI : uint + { + Vertex23BitPGI = 0x00000004, + Vertex4BitPGI = 0x00000008, + Color3BitPGI = 0x00010000, + Color4BitPGI = 0x00020000, + EdgeflagBitPGI = 0x00040000, + IndexBitPGI = 0x00080000, + MatAmbientBitPGI = 0x00100000, + MatAmbientAndDiffuseBitPGI = 0x00200000, + MatDiffuseBitPGI = 0x00400000, + MatEmissionBitPGI = 0x00800000, + MatColorIndexesBitPGI = 0x01000000, + MatShininessBitPGI = 0x02000000, + MatSpecularBitPGI = 0x04000000, + NormalBitPGI = 0x08000000, + Texcoord1BitPGI = 0x10000000, + Texcoord2BitPGI = 0x20000000, + Texcoord3BitPGI = 0x40000000, + Texcoord4BitPGI = 0x80000000 + } + + [Flags] + public enum BufferBitQCOM : uint + { + ColorBufferBit0QCOM = 0x00000001, + ColorBufferBit1QCOM = 0x00000002, + ColorBufferBit2QCOM = 0x00000004, + ColorBufferBit3QCOM = 0x00000008, + ColorBufferBit4QCOM = 0x00000010, + ColorBufferBit5QCOM = 0x00000020, + ColorBufferBit6QCOM = 0x00000040, + ColorBufferBit7QCOM = 0x00000080, + DepthBufferBit0QCOM = 0x00000100, + DepthBufferBit1QCOM = 0x00000200, + DepthBufferBit2QCOM = 0x00000400, + DepthBufferBit3QCOM = 0x00000800, + DepthBufferBit4QCOM = 0x00001000, + DepthBufferBit5QCOM = 0x00002000, + DepthBufferBit6QCOM = 0x00004000, + DepthBufferBit7QCOM = 0x00008000, + StencilBufferBit0QCOM = 0x00010000, + StencilBufferBit1QCOM = 0x00020000, + StencilBufferBit2QCOM = 0x00040000, + StencilBufferBit3QCOM = 0x00080000, + StencilBufferBit4QCOM = 0x00100000, + StencilBufferBit5QCOM = 0x00200000, + StencilBufferBit6QCOM = 0x00400000, + StencilBufferBit7QCOM = 0x00800000, + MultisampleBufferBit0QCOM = 0x01000000, + MultisampleBufferBit1QCOM = 0x02000000, + MultisampleBufferBit2QCOM = 0x04000000, + MultisampleBufferBit3QCOM = 0x08000000, + MultisampleBufferBit4QCOM = 0x10000000, + MultisampleBufferBit5QCOM = 0x20000000, + MultisampleBufferBit6QCOM = 0x40000000, + MultisampleBufferBit7QCOM = 0x80000000 + } + + [Flags] + public enum FoveationConfigBitQCOM : uint + { + FoveationEnableBitQCOM = 0x00000001, + FoveationScaledBinMethodBitQCOM = 0x00000002, + FoveationSubsampledLayoutMethodBitQCOM = 0x00000004 + } + + [Flags] + public enum FfdMaskSGIX : uint + { + TextureDeformationBitSGIX = 0x00000001, + GeometryDeformationBitSGIX = 0x00000002 + } + + public enum CommandOpcodesNV + { + TerminateSequenceCommandNV = 0x0000, + NopCommandNV = 0x0001, + DrawElementsCommandNV = 0x0002, + DrawArraysCommandNV = 0x0003, + DrawElementsStripCommandNV = 0x0004, + DrawArraysStripCommandNV = 0x0005, + DrawElementsInstancedCommandNV = 0x0006, + DrawArraysInstancedCommandNV = 0x0007, + ElementAddressCommandNV = 0x0008, + AttributeAddressCommandNV = 0x0009, + UniformAddressCommandNV = 0x000A, + BlendColorCommandNV = 0x000B, + StencilRefCommandNV = 0x000C, + LineWidthCommandNV = 0x000D, + PolygonOffsetCommandNV = 0x000E, + AlphaRefCommandNV = 0x000F, + ViewportCommandNV = 0x0010, + ScissorCommandNV = 0x0011, + FrontFaceCommandNV = 0x0012 + } + + public enum MapTextureFormatINTEL + { + LayoutDefaultINTEL = 0, + LayoutLinearINTEL = 1, + LayoutLinearCpuCachedINTEL = 2 + } + + public enum PathRenderingTokenNV + { + ClosePathNV = 0x00, + MoveToNV = 0x02, + RelativeMoveToNV = 0x03, + LineToNV = 0x04, + RelativeLineToNV = 0x05, + HorizontalLineToNV = 0x06, + RelativeHorizontalLineToNV = 0x07, + VerticalLineToNV = 0x08, + RelativeVerticalLineToNV = 0x09, + QuadraticCurveToNV = 0x0A, + RelativeQuadraticCurveToNV = 0x0B, + CubicCurveToNV = 0x0C, + RelativeCubicCurveToNV = 0x0D, + SmoothQuadraticCurveToNV = 0x0E, + RelativeSmoothQuadraticCurveToNV = 0x0F, + SmoothCubicCurveToNV = 0x10, + RelativeSmoothCubicCurveToNV = 0x11, + SmallCcwArcToNV = 0x12, + RelativeSmallCcwArcToNV = 0x13, + SmallCwArcToNV = 0x14, + RelativeSmallCwArcToNV = 0x15, + LargeCcwArcToNV = 0x16, + RelativeLargeCcwArcToNV = 0x17, + LargeCwArcToNV = 0x18, + RelativeLargeCwArcToNV = 0x19, + ConicCurveToNV = 0x1A, + RelativeConicCurveToNV = 0x1B, + SharedEdgeNV = 0xC0, + RoundedRectNV = 0xE8, + RelativeRoundedRectNV = 0xE9, + RoundedRect2NV = 0xEA, + RelativeRoundedRect2NV = 0xEB, + RoundedRect4NV = 0xEC, + RelativeRoundedRect4NV = 0xED, + RoundedRect8NV = 0xEE, + RelativeRoundedRect8NV = 0xEF, + RestartPathNV = 0xF0, + DupFirstCubicCurveToNV = 0xF2, + DupLastCubicCurveToNV = 0xF4, + RectNV = 0xF6, + RelativeRectNV = 0xF7, + CircularCcwArcToNV = 0xF8, + CircularCwArcToNV = 0xFA, + CircularTangentArcToNV = 0xFC, + ArcToNV = 0xFE, + RelativeArcToNV = 0xFF + } + + public enum TransformFeedbackTokenNV + { + NextBufferNV = -2, + SkipComponents4NV = -3, + SkipComponents3NV = -4, + SkipComponents2NV = -5, + SkipComponents1NV = -6 + } + + public enum TriangleListSUN + { + RestartSUN = 0x0001, + ReplaceMiddleSUN = 0x0002, + ReplaceOldestSUN = 0x0003 + } + + public enum RegisterCombinerPname + { + Combine = 0x8570, + CombineARB = 0x8570, + CombineEXT = 0x8570, + CombineRgb = 0x8571, + CombineRgbARB = 0x8571, + CombineRgbEXT = 0x8571, + CombineAlpha = 0x8572, + CombineAlphaARB = 0x8572, + CombineAlphaEXT = 0x8572, + RgbScale = 0x8573, + RgbScaleARB = 0x8573, + RgbScaleEXT = 0x8573, + AddSigned = 0x8574, + AddSignedARB = 0x8574, + AddSignedEXT = 0x8574, + Interpolate = 0x8575, + InterpolateARB = 0x8575, + InterpolateEXT = 0x8575, + Constant = 0x8576, + ConstantARB = 0x8576, + ConstantEXT = 0x8576, + ConstantNV = 0x8576, + PrimaryColor = 0x8577, + PrimaryColorARB = 0x8577, + PrimaryColorEXT = 0x8577, + Previous = 0x8578, + PreviousARB = 0x8578, + PreviousEXT = 0x8578, + Source0Rgb = 0x8580, + Source0RgbARB = 0x8580, + Source0RgbEXT = 0x8580, + Src0Rgb = 0x8580, + Source1Rgb = 0x8581, + Source1RgbARB = 0x8581, + Source1RgbEXT = 0x8581, + Src1Rgb = 0x8581, + Source2Rgb = 0x8582, + Source2RgbARB = 0x8582, + Source2RgbEXT = 0x8582, + Src2Rgb = 0x8582, + Source3RgbNV = 0x8583, + Source0Alpha = 0x8588, + Source0AlphaARB = 0x8588, + Source0AlphaEXT = 0x8588, + Src0Alpha = 0x8588, + Source1Alpha = 0x8589, + Source1AlphaARB = 0x8589, + Source1AlphaEXT = 0x8589, + Src1Alpha = 0x8589, + Src1AlphaEXT = 0x8589, + Source2Alpha = 0x858A, + Source2AlphaARB = 0x858A, + Source2AlphaEXT = 0x858A, + Src2Alpha = 0x858A, + Source3AlphaNV = 0x858B, + Operand0Rgb = 0x8590, + Operand0RgbARB = 0x8590, + Operand0RgbEXT = 0x8590, + Operand1Rgb = 0x8591, + Operand1RgbARB = 0x8591, + Operand1RgbEXT = 0x8591, + Operand2Rgb = 0x8592, + Operand2RgbARB = 0x8592, + Operand2RgbEXT = 0x8592, + Operand3RgbNV = 0x8593, + Operand0Alpha = 0x8598, + Operand0AlphaARB = 0x8598, + Operand0AlphaEXT = 0x8598, + Operand1Alpha = 0x8599, + Operand1AlphaARB = 0x8599, + Operand1AlphaEXT = 0x8599, + Operand2Alpha = 0x859A, + Operand2AlphaARB = 0x859A, + Operand2AlphaEXT = 0x859A, + Operand3AlphaNV = 0x859B + } + + public enum ShaderType + { + FragmentShader = 0x8B30, + FragmentShaderARB = 0x8B30, + VertexShader = 0x8B31, + VertexShaderARB = 0x8B31 + } + + public enum ContainerType + { + ProgramObjectARB = 0x8B40, + ProgramObjectEXT = 0x8B40 + } + + public enum AttributeType + { + FloatVec2 = 0x8B50, + FloatVec2ARB = 0x8B50, + FloatVec3 = 0x8B51, + FloatVec3ARB = 0x8B51, + FloatVec4 = 0x8B52, + FloatVec4ARB = 0x8B52, + IntVec2 = 0x8B53, + IntVec2ARB = 0x8B53, + IntVec3 = 0x8B54, + IntVec3ARB = 0x8B54, + IntVec4 = 0x8B55, + IntVec4ARB = 0x8B55, + Bool = 0x8B56, + BoolARB = 0x8B56, + BoolVec2 = 0x8B57, + BoolVec2ARB = 0x8B57, + BoolVec3 = 0x8B58, + BoolVec3ARB = 0x8B58, + BoolVec4 = 0x8B59, + BoolVec4ARB = 0x8B59, + FloatMat2 = 0x8B5A, + FloatMat2ARB = 0x8B5A, + FloatMat3 = 0x8B5B, + FloatMat3ARB = 0x8B5B, + FloatMat4 = 0x8B5C, + FloatMat4ARB = 0x8B5C, + Sampler1D = 0x8B5D, + Sampler1DARB = 0x8B5D, + Sampler2D = 0x8B5E, + Sampler2DARB = 0x8B5E, + Sampler3D = 0x8B5F, + Sampler3DARB = 0x8B5F, + Sampler3DOES = 0x8B5F, + SamplerCube = 0x8B60, + SamplerCubeARB = 0x8B60, + Sampler1DShadow = 0x8B61, + Sampler1DShadowARB = 0x8B61, + Sampler2DShadow = 0x8B62, + Sampler2DShadowARB = 0x8B62, + Sampler2DShadowEXT = 0x8B62, + Sampler2DRect = 0x8B63, + Sampler2DRectARB = 0x8B63, + Sampler2DRectShadow = 0x8B64, + Sampler2DRectShadowARB = 0x8B64, + FloatMat2x3 = 0x8B65, + FloatMat2x3NV = 0x8B65, + FloatMat2x4 = 0x8B66, + FloatMat2x4NV = 0x8B66, + FloatMat3x2 = 0x8B67, + FloatMat3x2NV = 0x8B67, + FloatMat3x4 = 0x8B68, + FloatMat3x4NV = 0x8B68, + FloatMat4x2 = 0x8B69, + FloatMat4x2NV = 0x8B69, + FloatMat4x3 = 0x8B6A, + FloatMat4x3NV = 0x8B6A + } + public enum AccumOp + { + Accum = 0x0100, + Load = 0x0101, + Return = 0x0102, + Mult = 0x0103, + Add = 0x0104, + } + + public enum AlphaFunction + { + Always = 0x0207, + Equal = 0x0202, + Gequal = 0x0206, + Greater = 0x0204, + Lequal = 0x0203, + Less = 0x0201, + Never = 0x0200, + Notequal = 0x0205, + } + + public enum BlendEquationModeEXT + { + AlphaMaxSGIX = 0x8321, + AlphaMinSGIX = 0x8320, + FuncAdd = 0x8006, + FuncAddEXT = 0x8006, + FuncReverseSubtract = 0x800B, + FuncReverseSubtractEXT = 0x800B, + FuncSubtract = 0x800A, + FuncSubtractEXT = 0x800A, + Max = 0x8008, + MaxEXT = 0x8008, + Min = 0x8007, + MinEXT = 0x8007, + } + + public enum Boolean + { + False = 0, + True = 1, + } + + public enum BufferTargetARB + { + ArrayBuffer = 0x8892, + AtomicCounterBuffer = 0x92C0, + CopyReadBuffer = 0x8F36, + CopyWriteBuffer = 0x8F37, + DispatchIndirectBuffer = 0x90EE, + DrawIndirectBuffer = 0x8F3F, + ElementArrayBuffer = 0x8893, + PixelPackBuffer = 0x88EB, + PixelUnpackBuffer = 0x88EC, + QueryBuffer = 0x9192, + ShaderStorageBuffer = 0x90D2, + TextureBuffer = 0x8C2A, + TransformFeedbackBuffer = 0x8C8E, + UniformBuffer = 0x8A11, + ParameterBuffer = 0x80EE, + } + + public enum BufferUsageARB + { + StreamDraw = 0x88E0, + StreamRead = 0x88E1, + StreamCopy = 0x88E2, + StaticDraw = 0x88E4, + StaticRead = 0x88E5, + StaticCopy = 0x88E6, + DynamicDraw = 0x88E8, + DynamicRead = 0x88E9, + DynamicCopy = 0x88EA, + } + + public enum BufferAccessARB + { + ReadOnly = 0x88B8, + WriteOnly = 0x88B9, + ReadWrite = 0x88BA, + } + + public enum ClipPlaneName + { + ClipDistance0 = 0x3000, + ClipDistance1 = 0x3001, + ClipDistance2 = 0x3002, + ClipDistance3 = 0x3003, + ClipDistance4 = 0x3004, + ClipDistance5 = 0x3005, + ClipDistance6 = 0x3006, + ClipDistance7 = 0x3007, + ClipPlane0 = 0x3000, + ClipPlane1 = 0x3001, + ClipPlane2 = 0x3002, + ClipPlane3 = 0x3003, + ClipPlane4 = 0x3004, + ClipPlane5 = 0x3005, + } + + public enum ColorMaterialFace + { + Back = 0x0405, + Front = 0x0404, + FrontAndBack = 0x0408, + } + + public enum ColorMaterialParameter + { + Ambient = 0x1200, + AmbientAndDiffuse = 0x1602, + Diffuse = 0x1201, + Emission = 0x1600, + Specular = 0x1202, + } + + public enum ColorPointerType + { + Byte = 0x1400, + Double = 0x140A, + Float = 0x1406, + Int = 0x1404, + Short = 0x1402, + UnsignedByte = 0x1401, + UnsignedInt = 0x1405, + UnsignedShort = 0x1403, + } + + public enum ColorTableParameterPNameSGI + { + ColorTableBias = 0x80D7, + ColorTableBiasSGI = 0x80D7, + ColorTableScale = 0x80D6, + ColorTableScaleSGI = 0x80D6, + } + + public enum ColorTableTargetSGI + { + ColorTable = 0x80D0, + ColorTableSGI = 0x80D0, + PostColorMatrixColorTable = 0x80D2, + PostColorMatrixColorTableSGI = 0x80D2, + PostConvolutionColorTable = 0x80D1, + PostConvolutionColorTableSGI = 0x80D1, + ProxyColorTable = 0x80D3, + ProxyColorTableSGI = 0x80D3, + ProxyPostColorMatrixColorTable = 0x80D5, + ProxyPostColorMatrixColorTableSGI = 0x80D5, + ProxyPostConvolutionColorTable = 0x80D4, + ProxyPostConvolutionColorTableSGI = 0x80D4, + ProxyTextureColorTableSGI = 0x80BD, + TextureColorTableSGI = 0x80BC, + } + + public enum ConvolutionBorderModeEXT + { + Reduce = 0x8016, + ReduceEXT = 0x8016, + } + + public enum ConvolutionParameterEXT + { + ConvolutionBorderMode = 0x8013, + ConvolutionBorderModeEXT = 0x8013, + ConvolutionFilterBias = 0x8015, + ConvolutionFilterBiasEXT = 0x8015, + ConvolutionFilterScale = 0x8014, + ConvolutionFilterScaleEXT = 0x8014, + } + + public enum ConvolutionTargetEXT + { + Convolution1D = 0x8010, + Convolution1DEXT = 0x8010, + Convolution2D = 0x8011, + Convolution2DEXT = 0x8011, + } + + public enum CullFaceMode + { + Back = 0x0405, + Front = 0x0404, + FrontAndBack = 0x0408, + } + + public enum DataType + { + } + + public enum DepthFunction + { + Always = 0x0207, + Equal = 0x0202, + Gequal = 0x0206, + Greater = 0x0204, + Lequal = 0x0203, + Less = 0x0201, + Never = 0x0200, + Notequal = 0x0205, + } + + public enum DrawBufferMode + { + Aux0 = 0x0409, + Aux1 = 0x040A, + Aux2 = 0x040B, + Aux3 = 0x040C, + Back = 0x0405, + BackLeft = 0x0402, + BackRight = 0x0403, + Front = 0x0404, + FrontAndBack = 0x0408, + FrontLeft = 0x0400, + FrontRight = 0x0401, + Left = 0x0406, + None = 0, + NoneOES = 0, + Right = 0x0407, + } + + public enum DrawElementsType + { + UnsignedByte = 0x1401, + UnsignedShort = 0x1403, + UnsignedInt = 0x1405, + } + + public enum EnableCap + { + AlphaTest = 0x0BC0, + AsyncDrawPixelsSGIX = 0x835D, + AsyncHistogramSGIX = 0x832C, + AsyncReadPixelsSGIX = 0x835E, + AsyncTexImageSGIX = 0x835C, + AutoNormal = 0x0D80, + Blend = 0x0BE2, + CalligraphicFragmentSGIX = 0x8183, + ClipPlane0 = 0x3000, + ClipPlane1 = 0x3001, + ClipPlane2 = 0x3002, + ClipPlane3 = 0x3003, + ClipPlane4 = 0x3004, + ClipPlane5 = 0x3005, + ColorArray = 0x8076, + ColorLogicOp = 0x0BF2, + ColorMaterial = 0x0B57, + ColorTableSGI = 0x80D0, + Convolution1DEXT = 0x8010, + Convolution2DEXT = 0x8011, + CullFace = 0x0B44, + DebugOutput = 0x92E0, + DebugOutputSynchronous = 0x8242, + DepthClamp = 0x864F, + DepthTest = 0x0B71, + Dither = 0x0BD0, + EdgeFlagArray = 0x8079, + Fog = 0x0B60, + FogOffsetSGIX = 0x8198, + FragmentColorMaterialSGIX = 0x8401, + FragmentLight0SGIX = 0x840C, + FragmentLight1SGIX = 0x840D, + FragmentLight2SGIX = 0x840E, + FragmentLight3SGIX = 0x840F, + FragmentLight4SGIX = 0x8410, + FragmentLight5SGIX = 0x8411, + FragmentLight6SGIX = 0x8412, + FragmentLight7SGIX = 0x8413, + FragmentLightingSGIX = 0x8400, + FramebufferSrgb = 0x8DB9, + FramezoomSGIX = 0x818B, + HistogramEXT = 0x8024, + IndexArray = 0x8077, + IndexLogicOp = 0x0BF1, + InterlaceSGIX = 0x8094, + IrInstrument1SGIX = 0x817F, + Light0 = 0x4000, + Light1 = 0x4001, + Light2 = 0x4002, + Light3 = 0x4003, + Light4 = 0x4004, + Light5 = 0x4005, + Light6 = 0x4006, + Light7 = 0x4007, + Lighting = 0x0B50, + LineSmooth = 0x0B20, + LineStipple = 0x0B24, + Map1Color4 = 0x0D90, + Map1Index = 0x0D91, + Map1Normal = 0x0D92, + Map1TextureCoord1 = 0x0D93, + Map1TextureCoord2 = 0x0D94, + Map1TextureCoord3 = 0x0D95, + Map1TextureCoord4 = 0x0D96, + Map1Vertex3 = 0x0D97, + Map1Vertex4 = 0x0D98, + Map2Color4 = 0x0DB0, + Map2Index = 0x0DB1, + Map2Normal = 0x0DB2, + Map2TextureCoord1 = 0x0DB3, + Map2TextureCoord2 = 0x0DB4, + Map2TextureCoord3 = 0x0DB5, + Map2TextureCoord4 = 0x0DB6, + Map2Vertex3 = 0x0DB7, + Map2Vertex4 = 0x0DB8, + MinmaxEXT = 0x802E, + Multisample = 0x809D, + MultisampleSgis = 0x809D, + Normalize = 0x0BA1, + NormalArray = 0x8075, + PixelTextureSgis = 0x8353, + PixelTexGenSGIX = 0x8139, + PointSmooth = 0x0B10, + PolygonOffsetFill = 0x8037, + PolygonOffsetLine = 0x2A02, + PolygonOffsetPoint = 0x2A01, + PolygonSmooth = 0x0B41, + PolygonStipple = 0x0B42, + PostColorMatrixColorTableSGI = 0x80D2, + PostConvolutionColorTableSGI = 0x80D1, + PrimitiveRestart = 0x8F9D, + PrimitiveRestartFixedIndex = 0x8D69, + ProgramPointSize = 0x8642, + RasterizerDiscard = 0x8C89, + ReferencePlaneSGIX = 0x817D, + RescaleNormalEXT = 0x803A, + SampleAlphaToCoverage = 0x809E, + SampleAlphaToMaskSgis = 0x809E, + SampleAlphaToOne = 0x809F, + SampleAlphaToOneSgis = 0x809F, + SampleCoverage = 0x80A0, + SampleMask = 0x8E51, + SampleMaskSgis = 0x80A0, + SampleShading = 0x8C36, + ScissorTest = 0x0C11, + Separable2DEXT = 0x8012, + SharedTexturePaletteEXT = 0x81FB, + SpriteSGIX = 0x8148, + StencilTest = 0x0B90, + Texture1D = 0x0DE0, + Texture2D = 0x0DE1, + Texture3DEXT = 0x806F, + Texture4dSgis = 0x8134, + TextureColorTableSGI = 0x80BC, + TextureCoordArray = 0x8078, + TextureCubeMapSeamless = 0x884F, + TextureGenQ = 0x0C63, + TextureGenR = 0x0C62, + TextureGenS = 0x0C60, + TextureGenT = 0x0C61, + VertexArray = 0x8074, + } + + public enum ErrorCode + { + InvalidEnum = 0x0500, + InvalidFramebufferOperation = 0x0506, + InvalidFramebufferOperationEXT = 0x0506, + InvalidFramebufferOperationOES = 0x0506, + InvalidOperation = 0x0502, + InvalidValue = 0x0501, + NoError = 0, + OutOfMemory = 0x0505, + StackOverflow = 0x0503, + StackUnderflow = 0x0504, + TableTooLarge = 0x8031, + TableTooLargeEXT = 0x8031, + TextureTooLargeEXT = 0x8065, + } + + public enum ExternalHandleType + { + HandleTypeOpaqueFdEXT = 0x9586, + HandleTypeOpaqueWin32EXT = 0x9587, + HandleTypeOpaqueWin32KmtEXT = 0x9588, + HandleTypeD3d12TilepoolEXT = 0x9589, + HandleTypeD3d12ResourceEXT = 0x958A, + HandleTypeD3d11ImageEXT = 0x958B, + HandleTypeD3d11ImageKmtEXT = 0x958C, + HandleTypeD3d12FenceEXT = 0x9594, + } + + public enum FeedbackType + { + Feedback2D = 0x0600, + Feedback3D = 0x0601, + Feedback3DColor = 0x0602, + Feedback3DColorTexture = 0x0603, + Feedback4dColorTexture = 0x0604, + } + + public enum FeedBackToken + { + BitmapToken = 0x0704, + CopyPixelToken = 0x0706, + DrawPixelToken = 0x0705, + LineResetToken = 0x0707, + LineToken = 0x0702, + PassThroughToken = 0x0700, + PointToken = 0x0701, + PolygonToken = 0x0703, + } + + public enum FfdTargetSGIX + { + GeometryDeformationSGIX = 0x8194, + TextureDeformationSGIX = 0x8195, + } + + public enum FogCoordinatePointerType + { + Float = 0x1406, + Double = 0x140A, + } + + public enum FogMode + { + Exp = 0x0800, + Exp2 = 0x0801, + FogFuncSgis = 0x812A, + Linear = 0x2601, + } + + public enum FogParameter + { + FogColor = 0x0B66, + FogDensity = 0x0B62, + FogEnd = 0x0B64, + FogIndex = 0x0B61, + FogMode = 0x0B65, + FogOffsetValueSGIX = 0x8199, + FogStart = 0x0B63, + } + + public enum FogPointerTypeEXT + { + Float = 0x1406, + Double = 0x140A, + } + + public enum FogPointerTypeIBM + { + Float = 0x1406, + Double = 0x140A, + } + + public enum FragmentLightModelParameterSGIX + { + FragmentLightModelAmbientSGIX = 0x840A, + FragmentLightModelLocalViewerSGIX = 0x8408, + FragmentLightModelNormalInterpolationSGIX = 0x840B, + FragmentLightModelTwoSideSGIX = 0x8409, + } + + public enum FramebufferFetchNoncoherent + { + FramebufferFetchNoncoherentQCOM = 0x96A2, + } + + public enum FrontFaceDirection + { + Ccw = 0x0901, + Cw = 0x0900, + } + + public enum GetColorTableParameterPNameSGI + { + ColorTableAlphaSizeSGI = 0x80DD, + ColorTableBiasSGI = 0x80D7, + ColorTableBlueSizeSGI = 0x80DC, + ColorTableFormatSGI = 0x80D8, + ColorTableGreenSizeSGI = 0x80DB, + ColorTableIntensitySizeSGI = 0x80DF, + ColorTableLuminanceSizeSGI = 0x80DE, + ColorTableRedSizeSGI = 0x80DA, + ColorTableScaleSGI = 0x80D6, + ColorTableWidthSGI = 0x80D9, + ColorTableBias = 0x80D7, + ColorTableScale = 0x80D6, + ColorTableFormat = 0x80D8, + ColorTableWidth = 0x80D9, + ColorTableRedSize = 0x80DA, + ColorTableGreenSize = 0x80DB, + ColorTableBlueSize = 0x80DC, + ColorTableAlphaSize = 0x80DD, + ColorTableLuminanceSize = 0x80DE, + ColorTableIntensitySize = 0x80DF, + } + + public enum GetConvolutionParameter + { + ConvolutionBorderModeEXT = 0x8013, + ConvolutionFilterBiasEXT = 0x8015, + ConvolutionFilterScaleEXT = 0x8014, + ConvolutionFormatEXT = 0x8017, + ConvolutionHeightEXT = 0x8019, + ConvolutionWidthEXT = 0x8018, + MaxConvolutionHeightEXT = 0x801B, + MaxConvolutionWidthEXT = 0x801A, + ConvolutionBorderMode = 0x8013, + ConvolutionBorderColor = 0x8154, + ConvolutionFilterScale = 0x8014, + ConvolutionFilterBias = 0x8015, + ConvolutionFormat = 0x8017, + ConvolutionWidth = 0x8018, + ConvolutionHeight = 0x8019, + MaxConvolutionWidth = 0x801A, + MaxConvolutionHeight = 0x801B, + } + + public enum GetHistogramParameterPNameEXT + { + HistogramAlphaSizeEXT = 0x802B, + HistogramBlueSizeEXT = 0x802A, + HistogramFormatEXT = 0x8027, + HistogramGreenSizeEXT = 0x8029, + HistogramLuminanceSizeEXT = 0x802C, + HistogramRedSizeEXT = 0x8028, + HistogramSinkEXT = 0x802D, + HistogramWidthEXT = 0x8026, + HistogramWidth = 0x8026, + HistogramFormat = 0x8027, + HistogramRedSize = 0x8028, + HistogramGreenSize = 0x8029, + HistogramBlueSize = 0x802A, + HistogramAlphaSize = 0x802B, + HistogramLuminanceSize = 0x802C, + HistogramSink = 0x802D, + } + + public enum GetMapQuery + { + Coeff = 0x0A00, + Domain = 0x0A02, + Order = 0x0A01, + } + + public enum GetMinmaxParameterPNameEXT + { + MinmaxFormat = 0x802F, + MinmaxFormatEXT = 0x802F, + MinmaxSink = 0x8030, + MinmaxSinkEXT = 0x8030, + } + + public enum GetPixelMap + { + PixelMapAToA = 0x0C79, + PixelMapBToB = 0x0C78, + PixelMapGToG = 0x0C77, + PixelMapIToA = 0x0C75, + PixelMapIToB = 0x0C74, + PixelMapIToG = 0x0C73, + PixelMapIToI = 0x0C70, + PixelMapIToR = 0x0C72, + PixelMapRToR = 0x0C76, + PixelMapSToS = 0x0C71, + } + + public enum GetPName + { + AccumAlphaBits = 0x0D5B, + AccumBlueBits = 0x0D5A, + AccumClearValue = 0x0B80, + AccumGreenBits = 0x0D59, + AccumRedBits = 0x0D58, + ActiveTexture = 0x84E0, + AliasedLineWidthRange = 0x846E, + AliasedPointSizeRange = 0x846D, + AlphaBias = 0x0D1D, + AlphaBits = 0x0D55, + AlphaScale = 0x0D1C, + AlphaTest = 0x0BC0, + AlphaTestFunc = 0x0BC1, + AlphaTestFuncQCOM = 0x0BC1, + AlphaTestQCOM = 0x0BC0, + AlphaTestRef = 0x0BC2, + AlphaTestRefQCOM = 0x0BC2, + ArrayBufferBinding = 0x8894, + AsyncDrawPixelsSGIX = 0x835D, + AsyncHistogramSGIX = 0x832C, + AsyncMarkerSGIX = 0x8329, + AsyncReadPixelsSGIX = 0x835E, + AsyncTexImageSGIX = 0x835C, + AttribStackDepth = 0x0BB0, + AutoNormal = 0x0D80, + AuxBuffers = 0x0C00, + Blend = 0x0BE2, + BlendColor = 0x8005, + BlendColorEXT = 0x8005, + BlendDst = 0x0BE0, + BlendDstAlpha = 0x80CA, + BlendDstRgb = 0x80C8, + BlendEquationAlpha = 0x883D, + BlendEquationEXT = 0x8009, + BlendEquationRgb = 0x8009, + BlendSrc = 0x0BE1, + BlendSrcAlpha = 0x80CB, + BlendSrcRgb = 0x80C9, + BlueBias = 0x0D1B, + BlueBits = 0x0D54, + BlueScale = 0x0D1A, + CalligraphicFragmentSGIX = 0x8183, + ClientAttribStackDepth = 0x0BB1, + ClipPlane0 = 0x3000, + ClipPlane1 = 0x3001, + ClipPlane2 = 0x3002, + ClipPlane3 = 0x3003, + ClipPlane4 = 0x3004, + ClipPlane5 = 0x3005, + ColorArray = 0x8076, + ColorArrayCountEXT = 0x8084, + ColorArraySize = 0x8081, + ColorArrayStride = 0x8083, + ColorArrayType = 0x8082, + ColorClearValue = 0x0C22, + ColorLogicOp = 0x0BF2, + ColorMaterial = 0x0B57, + ColorMaterialFace = 0x0B55, + ColorMaterialParameter = 0x0B56, + ColorMatrixSGI = 0x80B1, + ColorMatrixStackDepthSGI = 0x80B2, + ColorTableSGI = 0x80D0, + ColorWritemask = 0x0C23, + CompressedTextureFormats = 0x86A3, + ContextFlags = 0x821E, + Convolution1DEXT = 0x8010, + Convolution2DEXT = 0x8011, + ConvolutionHintSGIX = 0x8316, + CullFace = 0x0B44, + CullFaceMode = 0x0B45, + CurrentColor = 0x0B00, + CurrentIndex = 0x0B01, + CurrentNormal = 0x0B02, + CurrentProgram = 0x8B8D, + CurrentRasterColor = 0x0B04, + CurrentRasterDistance = 0x0B09, + CurrentRasterIndex = 0x0B05, + CurrentRasterPosition = 0x0B07, + CurrentRasterPositionValid = 0x0B08, + CurrentRasterTextureCoords = 0x0B06, + CurrentTextureCoords = 0x0B03, + DebugGroupStackDepth = 0x826D, + DeformationsMaskSGIX = 0x8196, + DepthBias = 0x0D1F, + DepthBits = 0x0D56, + DepthClearValue = 0x0B73, + DepthFunc = 0x0B74, + DepthRange = 0x0B70, + DepthScale = 0x0D1E, + DepthTest = 0x0B71, + DepthWritemask = 0x0B72, + DetailTexture2DBindingSgis = 0x8096, + DeviceLuidEXT = 0x9599, + DeviceNodeMaskEXT = 0x959A, + DeviceUuidEXT = 0x9597, + DispatchIndirectBufferBinding = 0x90EF, + DistanceAttenuationSgis = 0x8129, + Dither = 0x0BD0, + Doublebuffer = 0x0C32, + DrawBuffer = 0x0C01, + DrawBufferEXT = 0x0C01, + DrawFramebufferBinding = 0x8CA6, + DriverUuidEXT = 0x9598, + EdgeFlag = 0x0B43, + EdgeFlagArray = 0x8079, + EdgeFlagArrayCountEXT = 0x808D, + EdgeFlagArrayStride = 0x808C, + ElementArrayBufferBinding = 0x8895, + FeedbackBufferSize = 0x0DF1, + FeedbackBufferType = 0x0DF2, + Fog = 0x0B60, + FogColor = 0x0B66, + FogDensity = 0x0B62, + FogEnd = 0x0B64, + FogFuncPointsSgis = 0x812B, + FogHint = 0x0C54, + FogIndex = 0x0B61, + FogMode = 0x0B65, + FogOffsetSGIX = 0x8198, + FogOffsetValueSGIX = 0x8199, + FogStart = 0x0B63, + FragmentColorMaterialFaceSGIX = 0x8402, + FragmentColorMaterialParameterSGIX = 0x8403, + FragmentColorMaterialSGIX = 0x8401, + FragmentLight0SGIX = 0x840C, + FragmentLightingSGIX = 0x8400, + FragmentLightModelAmbientSGIX = 0x840A, + FragmentLightModelLocalViewerSGIX = 0x8408, + FragmentLightModelNormalInterpolationSGIX = 0x840B, + FragmentLightModelTwoSideSGIX = 0x8409, + FragmentShaderDerivativeHint = 0x8B8B, + FramezoomFactorSGIX = 0x818C, + FramezoomSGIX = 0x818B, + FrontFace = 0x0B46, + GenerateMipmapHintSgis = 0x8192, + GreenBias = 0x0D19, + GreenBits = 0x0D53, + GreenScale = 0x0D18, + HistogramEXT = 0x8024, + ImplementationColorReadFormat = 0x8B9B, + ImplementationColorReadType = 0x8B9A, + IndexArray = 0x8077, + IndexArrayCountEXT = 0x8087, + IndexArrayStride = 0x8086, + IndexArrayType = 0x8085, + IndexBits = 0x0D51, + IndexClearValue = 0x0C20, + IndexLogicOp = 0x0BF1, + IndexMode = 0x0C30, + IndexOffset = 0x0D13, + IndexShift = 0x0D12, + IndexWritemask = 0x0C21, + InstrumentMeasurementsSGIX = 0x8181, + InterlaceSGIX = 0x8094, + IrInstrument1SGIX = 0x817F, + LayerProvokingVertex = 0x825E, + Light0 = 0x4000, + Light1 = 0x4001, + Light2 = 0x4002, + Light3 = 0x4003, + Light4 = 0x4004, + Light5 = 0x4005, + Light6 = 0x4006, + Light7 = 0x4007, + Lighting = 0x0B50, + LightEnvModeSGIX = 0x8407, + LightModelAmbient = 0x0B53, + LightModelColorControl = 0x81F8, + LightModelLocalViewer = 0x0B51, + LightModelTwoSide = 0x0B52, + LineSmooth = 0x0B20, + LineSmoothHint = 0x0C52, + LineStipple = 0x0B24, + LineStipplePattern = 0x0B25, + LineStippleRepeat = 0x0B26, + LineWidth = 0x0B21, + LineWidthGranularity = 0x0B23, + LineWidthRange = 0x0B22, + ListBase = 0x0B32, + ListIndex = 0x0B33, + ListMode = 0x0B30, + LogicOp = 0x0BF1, + LogicOpMode = 0x0BF0, + MajorVersion = 0x821B, + Map1Color4 = 0x0D90, + Map1GridDomain = 0x0DD0, + Map1GridSegments = 0x0DD1, + Map1Index = 0x0D91, + Map1Normal = 0x0D92, + Map1TextureCoord1 = 0x0D93, + Map1TextureCoord2 = 0x0D94, + Map1TextureCoord3 = 0x0D95, + Map1TextureCoord4 = 0x0D96, + Map1Vertex3 = 0x0D97, + Map1Vertex4 = 0x0D98, + Map2Color4 = 0x0DB0, + Map2GridDomain = 0x0DD2, + Map2GridSegments = 0x0DD3, + Map2Index = 0x0DB1, + Map2Normal = 0x0DB2, + Map2TextureCoord1 = 0x0DB3, + Map2TextureCoord2 = 0x0DB4, + Map2TextureCoord3 = 0x0DB5, + Map2TextureCoord4 = 0x0DB6, + Map2Vertex3 = 0x0DB7, + Map2Vertex4 = 0x0DB8, + MapColor = 0x0D10, + MapStencil = 0x0D11, + MatrixMode = 0x0BA0, + Max3DTextureSize = 0x8073, + Max3DTextureSizeEXT = 0x8073, + Max4dTextureSizeSgis = 0x8138, + MaxActiveLightsSGIX = 0x8405, + MaxArrayTextureLayers = 0x88FF, + MaxAsyncDrawPixelsSGIX = 0x8360, + MaxAsyncHistogramSGIX = 0x832D, + MaxAsyncReadPixelsSGIX = 0x8361, + MaxAsyncTexImageSGIX = 0x835F, + MaxAttribStackDepth = 0x0D35, + MaxClientAttribStackDepth = 0x0D3B, + MaxClipmapDepthSGIX = 0x8177, + MaxClipmapVirtualDepthSGIX = 0x8178, + MaxClipDistances = 0x0D32, + MaxClipPlanes = 0x0D32, + MaxColorMatrixStackDepthSGI = 0x80B3, + MaxColorTextureSamples = 0x910E, + MaxCombinedAtomicCounters = 0x92D7, + MaxCombinedComputeUniformComponents = 0x8266, + MaxCombinedFragmentUniformComponents = 0x8A33, + MaxCombinedGeometryUniformComponents = 0x8A32, + MaxCombinedShaderStorageBlocks = 0x90DC, + MaxCombinedTextureImageUnits = 0x8B4D, + MaxCombinedUniformBlocks = 0x8A2E, + MaxCombinedVertexUniformComponents = 0x8A31, + MaxComputeAtomicCounters = 0x8265, + MaxComputeAtomicCounterBuffers = 0x8264, + MaxComputeShaderStorageBlocks = 0x90DB, + MaxComputeTextureImageUnits = 0x91BC, + MaxComputeUniformBlocks = 0x91BB, + MaxComputeUniformComponents = 0x8263, + MaxComputeWorkGroupCount = 0x91BE, + MaxComputeWorkGroupInvocations = 0x90EB, + MaxComputeWorkGroupSize = 0x91BF, + MaxCubeMapTextureSize = 0x851C, + MaxDebugGroupStackDepth = 0x826C, + MaxDepthTextureSamples = 0x910F, + MaxDrawBuffers = 0x8824, + MaxDualSourceDrawBuffers = 0x88FC, + MaxElementsIndices = 0x80E9, + MaxElementsVertices = 0x80E8, + MaxElementIndex = 0x8D6B, + MaxEvalOrder = 0x0D30, + MaxFogFuncPointsSgis = 0x812C, + MaxFragmentAtomicCounters = 0x92D6, + MaxFragmentInputComponents = 0x9125, + MaxFragmentLightsSGIX = 0x8404, + MaxFragmentShaderStorageBlocks = 0x90DA, + MaxFragmentUniformBlocks = 0x8A2D, + MaxFragmentUniformComponents = 0x8B49, + MaxFragmentUniformVectors = 0x8DFD, + MaxFramebufferHeight = 0x9316, + MaxFramebufferLayers = 0x9317, + MaxFramebufferSamples = 0x9318, + MaxFramebufferWidth = 0x9315, + MaxFramezoomFactorSGIX = 0x818D, + MaxGeometryAtomicCounters = 0x92D5, + MaxGeometryInputComponents = 0x9123, + MaxGeometryOutputComponents = 0x9124, + MaxGeometryShaderStorageBlocks = 0x90D7, + MaxGeometryTextureImageUnits = 0x8C29, + MaxGeometryUniformBlocks = 0x8A2C, + MaxGeometryUniformComponents = 0x8DDF, + MaxIntegerSamples = 0x9110, + MaxLabelLength = 0x82E8, + MaxLights = 0x0D31, + MaxListNesting = 0x0B31, + MaxModelviewStackDepth = 0x0D36, + MaxNameStackDepth = 0x0D37, + MaxPixelMapTable = 0x0D34, + MaxProgramTexelOffset = 0x8905, + MaxProjectionStackDepth = 0x0D38, + MaxRectangleTextureSize = 0x84F8, + MaxRenderbufferSize = 0x84E8, + MaxSampleMaskWords = 0x8E59, + MaxServerWaitTimeout = 0x9111, + MaxShaderStorageBufferBindings = 0x90DD, + MaxTessControlAtomicCounters = 0x92D3, + MaxTessControlShaderStorageBlocks = 0x90D8, + MaxTessEvaluationAtomicCounters = 0x92D4, + MaxTessEvaluationShaderStorageBlocks = 0x90D9, + MaxTextureBufferSize = 0x8C2B, + MaxTextureImageUnits = 0x8872, + MaxTextureLodBias = 0x84FD, + MaxTextureSize = 0x0D33, + MaxTextureStackDepth = 0x0D39, + MaxUniformBlockSize = 0x8A30, + MaxUniformBufferBindings = 0x8A2F, + MaxUniformLocations = 0x826E, + MaxVaryingComponents = 0x8B4B, + MaxVaryingFloats = 0x8B4B, + MaxVaryingVectors = 0x8DFC, + MaxVertexAtomicCounters = 0x92D2, + MaxVertexAttribs = 0x8869, + MaxVertexAttribBindings = 0x82DA, + MaxVertexAttribRelativeOffset = 0x82D9, + MaxVertexOutputComponents = 0x9122, + MaxVertexShaderStorageBlocks = 0x90D6, + MaxVertexTextureImageUnits = 0x8B4C, + MaxVertexUniformBlocks = 0x8A2B, + MaxVertexUniformComponents = 0x8B4A, + MaxVertexUniformVectors = 0x8DFB, + MaxViewports = 0x825B, + MaxViewportDims = 0x0D3A, + MinmaxEXT = 0x802E, + MinorVersion = 0x821C, + MinMapBufferAlignment = 0x90BC, + MinProgramTexelOffset = 0x8904, + Modelview0MatrixEXT = 0x0BA6, + Modelview0StackDepthEXT = 0x0BA3, + ModelviewMatrix = 0x0BA6, + ModelviewStackDepth = 0x0BA3, + MultisampleSgis = 0x809D, + NameStackDepth = 0x0D70, + Normalize = 0x0BA1, + NormalArray = 0x8075, + NormalArrayCountEXT = 0x8080, + NormalArrayStride = 0x807F, + NormalArrayType = 0x807E, + NumCompressedTextureFormats = 0x86A2, + NumDeviceUuidsEXT = 0x9596, + NumExtensions = 0x821D, + NumProgramBinaryFormats = 0x87FE, + NumShaderBinaryFormats = 0x8DF9, + PackAlignment = 0x0D05, + PackCmykHintEXT = 0x800E, + PackImageDepthSgis = 0x8131, + PackImageHeight = 0x806C, + PackImageHeightEXT = 0x806C, + PackLsbFirst = 0x0D01, + PackResampleSGIX = 0x842E, + PackRowLength = 0x0D02, + PackSkipImages = 0x806B, + PackSkipImagesEXT = 0x806B, + PackSkipPixels = 0x0D04, + PackSkipRows = 0x0D03, + PackSkipVolumesSgis = 0x8130, + PackSubsampleRateSGIX = 0x85A0, + PackSwapBytes = 0x0D00, + PerspectiveCorrectionHint = 0x0C50, + PixelMapAToASize = 0x0CB9, + PixelMapBToBSize = 0x0CB8, + PixelMapGToGSize = 0x0CB7, + PixelMapIToASize = 0x0CB5, + PixelMapIToBSize = 0x0CB4, + PixelMapIToGSize = 0x0CB3, + PixelMapIToISize = 0x0CB0, + PixelMapIToRSize = 0x0CB2, + PixelMapRToRSize = 0x0CB6, + PixelMapSToSSize = 0x0CB1, + PixelPackBufferBinding = 0x88ED, + PixelTextureSgis = 0x8353, + PixelTexGenModeSGIX = 0x832B, + PixelTexGenSGIX = 0x8139, + PixelTileBestAlignmentSGIX = 0x813E, + PixelTileCacheIncrementSGIX = 0x813F, + PixelTileCacheSizeSGIX = 0x8145, + PixelTileGridDepthSGIX = 0x8144, + PixelTileGridHeightSGIX = 0x8143, + PixelTileGridWidthSGIX = 0x8142, + PixelTileHeightSGIX = 0x8141, + PixelTileWidthSGIX = 0x8140, + PixelUnpackBufferBinding = 0x88EF, + PointFadeThresholdSize = 0x8128, + PointFadeThresholdSizeSgis = 0x8128, + PointSize = 0x0B11, + PointSizeGranularity = 0x0B13, + PointSizeMaxSgis = 0x8127, + PointSizeMinSgis = 0x8126, + PointSizeRange = 0x0B12, + PointSmooth = 0x0B10, + PointSmoothHint = 0x0C51, + PolygonMode = 0x0B40, + PolygonOffsetBiasEXT = 0x8039, + PolygonOffsetFactor = 0x8038, + PolygonOffsetFill = 0x8037, + PolygonOffsetLine = 0x2A02, + PolygonOffsetPoint = 0x2A01, + PolygonOffsetUnits = 0x2A00, + PolygonSmooth = 0x0B41, + PolygonSmoothHint = 0x0C53, + PolygonStipple = 0x0B42, + PostColorMatrixAlphaBiasSGI = 0x80BB, + PostColorMatrixAlphaScaleSGI = 0x80B7, + PostColorMatrixBlueBiasSGI = 0x80BA, + PostColorMatrixBlueScaleSGI = 0x80B6, + PostColorMatrixColorTableSGI = 0x80D2, + PostColorMatrixGreenBiasSGI = 0x80B9, + PostColorMatrixGreenScaleSGI = 0x80B5, + PostColorMatrixRedBiasSGI = 0x80B8, + PostColorMatrixRedScaleSGI = 0x80B4, + PostConvolutionAlphaBiasEXT = 0x8023, + PostConvolutionAlphaScaleEXT = 0x801F, + PostConvolutionBlueBiasEXT = 0x8022, + PostConvolutionBlueScaleEXT = 0x801E, + PostConvolutionColorTableSGI = 0x80D1, + PostConvolutionGreenBiasEXT = 0x8021, + PostConvolutionGreenScaleEXT = 0x801D, + PostConvolutionRedBiasEXT = 0x8020, + PostConvolutionRedScaleEXT = 0x801C, + PostTextureFilterBiasRangeSGIX = 0x817B, + PostTextureFilterScaleRangeSGIX = 0x817C, + PrimitiveRestartIndex = 0x8F9E, + ProgramBinaryFormats = 0x87FF, + ProgramPipelineBinding = 0x825A, + ProgramPointSize = 0x8642, + ProjectionMatrix = 0x0BA7, + ProjectionStackDepth = 0x0BA4, + ProvokingVertex = 0x8E4F, + ReadBuffer = 0x0C02, + ReadBufferEXT = 0x0C02, + ReadBufferNV = 0x0C02, + ReadFramebufferBinding = 0x8CAA, + RedBias = 0x0D15, + RedBits = 0x0D52, + RedScale = 0x0D14, + ReferencePlaneEquationSGIX = 0x817E, + ReferencePlaneSGIX = 0x817D, + RenderbufferBinding = 0x8CA7, + RenderMode = 0x0C40, + RescaleNormalEXT = 0x803A, + RgbaMode = 0x0C31, + SamplerBinding = 0x8919, + Samples = 0x80A9, + SamplesSgis = 0x80A9, + SampleAlphaToMaskSgis = 0x809E, + SampleAlphaToOneSgis = 0x809F, + SampleBuffers = 0x80A8, + SampleBuffersSgis = 0x80A8, + SampleCoverageInvert = 0x80AB, + SampleCoverageValue = 0x80AA, + SampleMaskInvertSgis = 0x80AB, + SampleMaskSgis = 0x80A0, + SampleMaskValueSgis = 0x80AA, + SamplePatternSgis = 0x80AC, + ScissorBox = 0x0C10, + ScissorTest = 0x0C11, + SelectionBufferSize = 0x0DF4, + Separable2DEXT = 0x8012, + ShaderCompiler = 0x8DFA, + ShaderStorageBufferBinding = 0x90D3, + ShaderStorageBufferOffsetAlignment = 0x90DF, + ShaderStorageBufferSize = 0x90D5, + ShaderStorageBufferStart = 0x90D4, + ShadeModel = 0x0B54, + SharedTexturePaletteEXT = 0x81FB, + SmoothLineWidthGranularity = 0x0B23, + SmoothLineWidthRange = 0x0B22, + SmoothPointSizeGranularity = 0x0B13, + SmoothPointSizeRange = 0x0B12, + SpriteAxisSGIX = 0x814A, + SpriteModeSGIX = 0x8149, + SpriteSGIX = 0x8148, + SpriteTranslationSGIX = 0x814B, + StencilBackFail = 0x8801, + StencilBackFunc = 0x8800, + StencilBackPassDepthFail = 0x8802, + StencilBackPassDepthPass = 0x8803, + StencilBackRef = 0x8CA3, + StencilBackValueMask = 0x8CA4, + StencilBackWritemask = 0x8CA5, + StencilBits = 0x0D57, + StencilClearValue = 0x0B91, + StencilFail = 0x0B94, + StencilFunc = 0x0B92, + StencilPassDepthFail = 0x0B95, + StencilPassDepthPass = 0x0B96, + StencilRef = 0x0B97, + StencilTest = 0x0B90, + StencilValueMask = 0x0B93, + StencilWritemask = 0x0B98, + Stereo = 0x0C33, + SubpixelBits = 0x0D50, + Texture1D = 0x0DE0, + Texture2D = 0x0DE1, + Texture3DBindingEXT = 0x806A, + Texture3DEXT = 0x806F, + Texture4dBindingSgis = 0x814F, + Texture4dSgis = 0x8134, + TextureBinding1D = 0x8068, + TextureBinding1DArray = 0x8C1C, + TextureBinding2D = 0x8069, + TextureBinding2DArray = 0x8C1D, + TextureBinding2DMultisample = 0x9104, + TextureBinding2DMultisampleArray = 0x9105, + TextureBinding3D = 0x806A, + TextureBindingBuffer = 0x8C2C, + TextureBindingCubeMap = 0x8514, + TextureBindingRectangle = 0x84F6, + TextureBufferOffsetAlignment = 0x919F, + TextureColorTableSGI = 0x80BC, + TextureCompressionHint = 0x84EF, + TextureCoordArray = 0x8078, + TextureCoordArrayCountEXT = 0x808B, + TextureCoordArraySize = 0x8088, + TextureCoordArrayStride = 0x808A, + TextureCoordArrayType = 0x8089, + TextureGenQ = 0x0C63, + TextureGenR = 0x0C62, + TextureGenS = 0x0C60, + TextureGenT = 0x0C61, + TextureMatrix = 0x0BA8, + TextureStackDepth = 0x0BA5, + Timestamp = 0x8E28, + TransformFeedbackBufferBinding = 0x8C8F, + TransformFeedbackBufferSize = 0x8C85, + TransformFeedbackBufferStart = 0x8C84, + UniformBufferBinding = 0x8A28, + UniformBufferOffsetAlignment = 0x8A34, + UniformBufferSize = 0x8A2A, + UniformBufferStart = 0x8A29, + UnpackAlignment = 0x0CF5, + UnpackCmykHintEXT = 0x800F, + UnpackImageDepthSgis = 0x8133, + UnpackImageHeight = 0x806E, + UnpackImageHeightEXT = 0x806E, + UnpackLsbFirst = 0x0CF1, + UnpackResampleSGIX = 0x842F, + UnpackRowLength = 0x0CF2, + UnpackSkipImages = 0x806D, + UnpackSkipImagesEXT = 0x806D, + UnpackSkipPixels = 0x0CF4, + UnpackSkipRows = 0x0CF3, + UnpackSkipVolumesSgis = 0x8132, + UnpackSubsampleRateSGIX = 0x85A1, + UnpackSwapBytes = 0x0CF0, + VertexArray = 0x8074, + VertexArrayBinding = 0x85B5, + VertexArrayCountEXT = 0x807D, + VertexArraySize = 0x807A, + VertexArrayStride = 0x807C, + VertexArrayType = 0x807B, + VertexBindingDivisor = 0x82D6, + VertexBindingOffset = 0x82D7, + VertexBindingStride = 0x82D8, + VertexPreclipHintSGIX = 0x83EF, + VertexPreclipSGIX = 0x83EE, + Viewport = 0x0BA2, + ViewportBoundsRange = 0x825D, + ViewportIndexProvokingVertex = 0x825F, + ViewportSubpixelBits = 0x825C, + ZoomX = 0x0D16, + ZoomY = 0x0D17, + } + + public enum GetPointervPName + { + ColorArrayPointer = 0x8090, + ColorArrayPointerEXT = 0x8090, + EdgeFlagArrayPointer = 0x8093, + EdgeFlagArrayPointerEXT = 0x8093, + FeedbackBufferPointer = 0x0DF0, + IndexArrayPointer = 0x8091, + IndexArrayPointerEXT = 0x8091, + InstrumentBufferPointerSGIX = 0x8180, + NormalArrayPointer = 0x808F, + NormalArrayPointerEXT = 0x808F, + SelectionBufferPointer = 0x0DF3, + TextureCoordArrayPointer = 0x8092, + TextureCoordArrayPointerEXT = 0x8092, + VertexArrayPointer = 0x808E, + VertexArrayPointerEXT = 0x808E, + DebugCallbackFunction = 0x8244, + DebugCallbackUserParam = 0x8245, + } + + public enum GetTextureParameter + { + DetailTextureFuncPointsSgis = 0x809C, + DetailTextureLevelSgis = 0x809A, + DetailTextureModeSgis = 0x809B, + DualTextureSelectSgis = 0x8124, + GenerateMipmapSgis = 0x8191, + PostTextureFilterBiasSGIX = 0x8179, + PostTextureFilterScaleSGIX = 0x817A, + QuadTextureSelectSgis = 0x8125, + ShadowAmbientSGIX = 0x80BF, + SharpenTextureFuncPointsSgis = 0x80B0, + Texture4dsizeSgis = 0x8136, + TextureAlphaSize = 0x805F, + TextureBaseLevelSgis = 0x813C, + TextureBlueSize = 0x805E, + TextureBorder = 0x1005, + TextureBorderColor = 0x1004, + TextureBorderColorNV = 0x1004, + TextureClipmapCenterSGIX = 0x8171, + TextureClipmapDepthSGIX = 0x8176, + TextureClipmapFrameSGIX = 0x8172, + TextureClipmapLodOffsetSGIX = 0x8175, + TextureClipmapOffsetSGIX = 0x8173, + TextureClipmapVirtualDepthSGIX = 0x8174, + TextureCompareOperatorSGIX = 0x819B, + TextureCompareSGIX = 0x819A, + TextureComponents = 0x1003, + TextureDepthEXT = 0x8071, + TextureFilter4SizeSgis = 0x8147, + TextureGequalRSGIX = 0x819D, + TextureGreenSize = 0x805D, + TextureHeight = 0x1001, + TextureIntensitySize = 0x8061, + TextureInternalFormat = 0x1003, + TextureLequalRSGIX = 0x819C, + TextureLodBiasRSGIX = 0x8190, + TextureLodBiasSSGIX = 0x818E, + TextureLodBiasTSGIX = 0x818F, + TextureLuminanceSize = 0x8060, + TextureMagFilter = 0x2800, + TextureMaxClampRSGIX = 0x836B, + TextureMaxClampSSGIX = 0x8369, + TextureMaxClampTSGIX = 0x836A, + TextureMaxLevelSgis = 0x813D, + TextureMaxLodSgis = 0x813B, + TextureMinFilter = 0x2801, + TextureMinLodSgis = 0x813A, + TexturePriority = 0x8066, + TextureRedSize = 0x805C, + TextureResident = 0x8067, + TextureWidth = 0x1000, + TextureWrapQSgis = 0x8137, + TextureWrapREXT = 0x8072, + TextureWrapS = 0x2802, + TextureWrapT = 0x2803, + } + + public enum HintMode + { + DontCare = 0x1100, + Fastest = 0x1101, + Nicest = 0x1102, + } + + public enum HintTarget + { + AllowDrawFrgHintPGI = 0x1A210, + AllowDrawMemHintPGI = 0x1A211, + AllowDrawObjHintPGI = 0x1A20E, + AllowDrawWinHintPGI = 0x1A20F, + AlwaysFastHintPGI = 0x1A20C, + AlwaysSoftHintPGI = 0x1A20D, + BackNormalsHintPGI = 0x1A223, + BinningControlHintQCOM = 0x8FB0, + ClipFarHintPGI = 0x1A221, + ClipNearHintPGI = 0x1A220, + ClipVolumeClippingHintEXT = 0x80F0, + ConserveMemoryHintPGI = 0x1A1FD, + ConvolutionHintSGIX = 0x8316, + FogHint = 0x0C54, + FragmentShaderDerivativeHint = 0x8B8B, + FragmentShaderDerivativeHintARB = 0x8B8B, + FragmentShaderDerivativeHintOES = 0x8B8B, + FullStippleHintPGI = 0x1A219, + GenerateMipmapHint = 0x8192, + GenerateMipmapHintSgis = 0x8192, + LineQualityHintSGIX = 0x835B, + LineSmoothHint = 0x0C52, + MaterialSideHintPGI = 0x1A22C, + MaxVertexHintPGI = 0x1A22D, + MultisampleFilterHintNV = 0x8534, + NativeGraphicsBeginHintPGI = 0x1A203, + NativeGraphicsEndHintPGI = 0x1A204, + PackCmykHintEXT = 0x800E, + PerspectiveCorrectionHint = 0x0C50, + PhongHintWin = 0x80EB, + PointSmoothHint = 0x0C51, + PolygonSmoothHint = 0x0C53, + PreferDoublebufferHintPGI = 0x1A1F8, + ProgramBinaryRetrievableHint = 0x8257, + ReclaimMemoryHintPGI = 0x1A1FE, + ScalebiasHintSGIX = 0x8322, + StrictDepthfuncHintPGI = 0x1A216, + StrictLightingHintPGI = 0x1A217, + StrictScissorHintPGI = 0x1A218, + TextureCompressionHint = 0x84EF, + TextureCompressionHintARB = 0x84EF, + TextureMultiBufferHintSGIX = 0x812E, + TextureStorageHintAPPLE = 0x85BC, + TransformHintAPPLE = 0x85B1, + UnpackCmykHintEXT = 0x800F, + VertexArrayStorageHintAPPLE = 0x851F, + VertexConsistentHintPGI = 0x1A22B, + VertexDataHintPGI = 0x1A22A, + VertexPreclipHintSGIX = 0x83EF, + VertexPreclipSGIX = 0x83EE, + WideLineHintPGI = 0x1A222, + } + + public enum HistogramTargetEXT + { + Histogram = 0x8024, + HistogramEXT = 0x8024, + ProxyHistogram = 0x8025, + ProxyHistogramEXT = 0x8025, + } + + public enum IndexPointerType + { + Double = 0x140A, + Float = 0x1406, + Int = 0x1404, + Short = 0x1402, + } + + public enum InterleavedArrayFormat + { + C3fV3f = 0x2A24, + C4fN3fV3f = 0x2A26, + C4ubV2f = 0x2A22, + C4ubV3f = 0x2A23, + N3fV3f = 0x2A25, + T2fC3fV3f = 0x2A2A, + T2fC4fN3fV3f = 0x2A2C, + T2fC4ubV3f = 0x2A29, + T2fN3fV3f = 0x2A2B, + T2fV3f = 0x2A27, + T4fC4fN3fV4f = 0x2A2D, + T4fV4f = 0x2A28, + V2f = 0x2A20, + V3f = 0x2A21, + } + + public enum LightEnvModeSGIX + { + Add = 0x0104, + Modulate = 0x2100, + Replace = 0x1E01, + } + + public enum LightEnvParameterSGIX + { + LightEnvModeSGIX = 0x8407, + } + + public enum LightModelColorControl + { + SeparateSpecularColor = 0x81FA, + SeparateSpecularColorEXT = 0x81FA, + SingleColor = 0x81F9, + SingleColorEXT = 0x81F9, + } + + public enum LightModelParameter + { + LightModelAmbient = 0x0B53, + LightModelColorControl = 0x81F8, + LightModelColorControlEXT = 0x81F8, + LightModelLocalViewer = 0x0B51, + LightModelTwoSide = 0x0B52, + } + + public enum LightName + { + FragmentLight0SGIX = 0x840C, + FragmentLight1SGIX = 0x840D, + FragmentLight2SGIX = 0x840E, + FragmentLight3SGIX = 0x840F, + FragmentLight4SGIX = 0x8410, + FragmentLight5SGIX = 0x8411, + FragmentLight6SGIX = 0x8412, + FragmentLight7SGIX = 0x8413, + Light0 = 0x4000, + Light1 = 0x4001, + Light2 = 0x4002, + Light3 = 0x4003, + Light4 = 0x4004, + Light5 = 0x4005, + Light6 = 0x4006, + Light7 = 0x4007, + } + + public enum LightParameter + { + Ambient = 0x1200, + ConstantAttenuation = 0x1207, + Diffuse = 0x1201, + LinearAttenuation = 0x1208, + Position = 0x1203, + QuadraticAttenuation = 0x1209, + Specular = 0x1202, + SpotCutoff = 0x1206, + SpotDirection = 0x1204, + SpotExponent = 0x1205, + } + + public enum ListMode + { + Compile = 0x1300, + CompileAndExecute = 0x1301, + } + + public enum ListNameType + { + Type2Bytes = 0x1407, + Type3Bytes = 0x1408, + Type4Bytes = 0x1409, + Byte = 0x1400, + Float = 0x1406, + Int = 0x1404, + Short = 0x1402, + UnsignedByte = 0x1401, + UnsignedInt = 0x1405, + UnsignedShort = 0x1403, + } + + public enum ListParameterName + { + ListPrioritySGIX = 0x8182, + } + + public enum LogicOp + { + And = 0x1501, + AndInverted = 0x1504, + AndReverse = 0x1502, + Clear = 0x1500, + Copy = 0x1503, + CopyInverted = 0x150C, + Equiv = 0x1509, + Invert = 0x150A, + Nand = 0x150E, + Noop = 0x1505, + Nor = 0x1508, + Or = 0x1507, + OrInverted = 0x150D, + OrReverse = 0x150B, + Set = 0x150F, + Xor = 0x1506, + } + + public enum MapTarget + { + GeometryDeformationSGIX = 0x8194, + Map1Color4 = 0x0D90, + Map1Index = 0x0D91, + Map1Normal = 0x0D92, + Map1TextureCoord1 = 0x0D93, + Map1TextureCoord2 = 0x0D94, + Map1TextureCoord3 = 0x0D95, + Map1TextureCoord4 = 0x0D96, + Map1Vertex3 = 0x0D97, + Map1Vertex4 = 0x0D98, + Map2Color4 = 0x0DB0, + Map2Index = 0x0DB1, + Map2Normal = 0x0DB2, + Map2TextureCoord1 = 0x0DB3, + Map2TextureCoord2 = 0x0DB4, + Map2TextureCoord3 = 0x0DB5, + Map2TextureCoord4 = 0x0DB6, + Map2Vertex3 = 0x0DB7, + Map2Vertex4 = 0x0DB8, + TextureDeformationSGIX = 0x8195, + } + + public enum MaterialFace + { + Back = 0x0405, + Front = 0x0404, + FrontAndBack = 0x0408, + } + + public enum MaterialParameter + { + Ambient = 0x1200, + AmbientAndDiffuse = 0x1602, + ColorIndexes = 0x1603, + Diffuse = 0x1201, + Emission = 0x1600, + Shininess = 0x1601, + Specular = 0x1202, + } + + public enum MatrixMode + { + Modelview = 0x1700, + Modelview0EXT = 0x1700, + Projection = 0x1701, + Texture = 0x1702, + } + + public enum MemoryObjectParameterName + { + DedicatedMemoryObjectEXT = 0x9581, + ProtectedMemoryObjectEXT = 0x959B, + } + + public enum MeshMode1 + { + Line = 0x1B01, + Point = 0x1B00, + } + + public enum MeshMode2 + { + Fill = 0x1B02, + Line = 0x1B01, + Point = 0x1B00, + } + + public enum MinmaxTargetEXT + { + Minmax = 0x802E, + MinmaxEXT = 0x802E, + } + + public enum NormalPointerType + { + Byte = 0x1400, + Double = 0x140A, + Float = 0x1406, + Int = 0x1404, + Short = 0x1402, + } + + public enum PixelCopyType + { + Color = 0x1800, + ColorEXT = 0x1800, + Depth = 0x1801, + DepthEXT = 0x1801, + Stencil = 0x1802, + StencilEXT = 0x1802, + } + + public enum PixelFormat + { + AbgrEXT = 0x8000, + Alpha = 0x1906, + Bgr = 0x80E0, + BgrInteger = 0x8D9A, + Bgra = 0x80E1, + BgraInteger = 0x8D9B, + Blue = 0x1905, + BlueInteger = 0x8D96, + CmykaEXT = 0x800D, + CmykEXT = 0x800C, + ColorIndex = 0x1900, + DepthComponent = 0x1902, + DepthStencil = 0x84F9, + Green = 0x1904, + GreenInteger = 0x8D95, + Luminance = 0x1909, + LuminanceAlpha = 0x190A, + Red = 0x1903, + RedEXT = 0x1903, + RedInteger = 0x8D94, + Rg = 0x8227, + RgInteger = 0x8228, + Rgb = 0x1907, + RgbInteger = 0x8D98, + Rgba = 0x1908, + RgbaInteger = 0x8D99, + StencilIndex = 0x1901, + UnsignedInt = 0x1405, + UnsignedShort = 0x1403, + Ycrcb422SGIX = 0x81BB, + Ycrcb444SGIX = 0x81BC, + } + + public enum InternalFormat + { + Alpha12 = 0x803D, + Alpha16 = 0x803E, + Alpha4 = 0x803B, + Alpha8 = 0x803C, + DualAlpha12Sgis = 0x8112, + DualAlpha16Sgis = 0x8113, + DualAlpha4Sgis = 0x8110, + DualAlpha8Sgis = 0x8111, + DualIntensity12Sgis = 0x811A, + DualIntensity16Sgis = 0x811B, + DualIntensity4Sgis = 0x8118, + DualIntensity8Sgis = 0x8119, + DualLuminance12Sgis = 0x8116, + DualLuminance16Sgis = 0x8117, + DualLuminance4Sgis = 0x8114, + DualLuminance8Sgis = 0x8115, + DualLuminanceAlpha4Sgis = 0x811C, + DualLuminanceAlpha8Sgis = 0x811D, + Intensity = 0x8049, + Intensity12 = 0x804C, + Intensity16 = 0x804D, + Intensity4 = 0x804A, + Intensity8 = 0x804B, + Luminance12 = 0x8041, + Luminance12Alpha12 = 0x8047, + Luminance12Alpha4 = 0x8046, + Luminance16 = 0x8042, + Luminance16Alpha16 = 0x8048, + Luminance4 = 0x803F, + Luminance4Alpha4 = 0x8043, + Luminance6Alpha2 = 0x8044, + Luminance8 = 0x8040, + Luminance8Alpha8 = 0x8045, + QuadAlpha4Sgis = 0x811E, + QuadAlpha8Sgis = 0x811F, + QuadIntensity4Sgis = 0x8122, + QuadIntensity8Sgis = 0x8123, + QuadLuminance4Sgis = 0x8120, + QuadLuminance8Sgis = 0x8121, + Red = 0x1903, + RedEXT = 0x1903, + R8 = 0x8229, + R8EXT = 0x8229, + R8Snorm = 0x8F94, + R16 = 0x822A, + R16EXT = 0x822A, + R16Snorm = 0x8F98, + R16SnormEXT = 0x8F98, + R16f = 0x822D, + R16fEXT = 0x822D, + R32f = 0x822E, + R32fEXT = 0x822E, + R8i = 0x8231, + R16i = 0x8233, + R32i = 0x8235, + R8ui = 0x8232, + R16ui = 0x8234, + R32ui = 0x8236, + Rg = 0x8227, + Rg8 = 0x822B, + Rg8EXT = 0x822B, + Rg8Snorm = 0x8F95, + Rg16 = 0x822C, + Rg16EXT = 0x822C, + Rg16Snorm = 0x8F99, + Rg16SnormEXT = 0x8F99, + Rg16f = 0x822F, + Rg16fEXT = 0x822F, + Rg32f = 0x8230, + Rg32fEXT = 0x8230, + Rg8i = 0x8237, + Rg16i = 0x8239, + Rg32i = 0x823B, + Rg8ui = 0x8238, + Rg16ui = 0x823A, + Rg32ui = 0x823C, + Rgb = 0x1907, + Rgb2EXT = 0x804E, + Rgb4 = 0x804F, + Rgb4EXT = 0x804F, + Rgb5 = 0x8050, + Rgb5EXT = 0x8050, + Rgb8 = 0x8051, + Rgb8EXT = 0x8051, + Rgb8OES = 0x8051, + Rgb8Snorm = 0x8F96, + Rgb10 = 0x8052, + Rgb10EXT = 0x8052, + Rgb12 = 0x8053, + Rgb12EXT = 0x8053, + Rgb16 = 0x8054, + Rgb16EXT = 0x8054, + Rgb16f = 0x881B, + Rgb16fARB = 0x881B, + Rgb16fEXT = 0x881B, + Rgb16Snorm = 0x8F9A, + Rgb16SnormEXT = 0x8F9A, + Rgb8i = 0x8D8F, + Rgb16i = 0x8D89, + Rgb32i = 0x8D83, + Rgb8ui = 0x8D7D, + Rgb16ui = 0x8D77, + Rgb32ui = 0x8D71, + Srgb = 0x8C40, + SrgbEXT = 0x8C40, + SrgbAlpha = 0x8C42, + SrgbAlphaEXT = 0x8C42, + Srgb8 = 0x8C41, + Srgb8EXT = 0x8C41, + Srgb8NV = 0x8C41, + Srgb8Alpha8 = 0x8C43, + Srgb8Alpha8EXT = 0x8C43, + R3G3B2 = 0x2A10, + R11fG11fB10f = 0x8C3A, + R11fG11fB10fAPPLE = 0x8C3A, + R11fG11fB10fEXT = 0x8C3A, + Rgb9E5 = 0x8C3D, + Rgb9E5APPLE = 0x8C3D, + Rgb9E5EXT = 0x8C3D, + Rgba = 0x1908, + Rgba4 = 0x8056, + Rgba4EXT = 0x8056, + Rgba4OES = 0x8056, + Rgb5A1 = 0x8057, + Rgb5A1EXT = 0x8057, + Rgb5A1OES = 0x8057, + Rgba8 = 0x8058, + Rgba8EXT = 0x8058, + Rgba8OES = 0x8058, + Rgba8Snorm = 0x8F97, + Rgb10A2 = 0x8059, + Rgb10A2EXT = 0x8059, + Rgba12 = 0x805A, + Rgba12EXT = 0x805A, + Rgba16 = 0x805B, + Rgba16EXT = 0x805B, + Rgba16f = 0x881A, + Rgba16fARB = 0x881A, + Rgba16fEXT = 0x881A, + Rgba32f = 0x8814, + Rgba32fARB = 0x8814, + Rgba32fEXT = 0x8814, + Rgba8i = 0x8D8E, + Rgba16i = 0x8D88, + Rgba32i = 0x8D82, + Rgba8ui = 0x8D7C, + Rgba16ui = 0x8D76, + Rgba32ui = 0x8D70, + Rgb10A2ui = 0x906F, + DepthComponent = 0x1902, + DepthComponent16 = 0x81A5, + DepthComponent16ARB = 0x81A5, + DepthComponent16OES = 0x81A5, + DepthComponent16SGIX = 0x81A5, + DepthComponent24ARB = 0x81A6, + DepthComponent24OES = 0x81A6, + DepthComponent24SGIX = 0x81A6, + DepthComponent32ARB = 0x81A7, + DepthComponent32OES = 0x81A7, + DepthComponent32SGIX = 0x81A7, + DepthComponent32f = 0x8CAC, + DepthComponent32fNV = 0x8DAB, + DepthStencil = 0x84F9, + DepthStencilEXT = 0x84F9, + DepthStencilMESA = 0x8750, + DepthStencilNV = 0x84F9, + DepthStencilOES = 0x84F9, + Depth24Stencil8 = 0x88F0, + Depth24Stencil8EXT = 0x88F0, + Depth24Stencil8OES = 0x88F0, + Depth32fStencil8 = 0x8CAD, + Depth32fStencil8NV = 0x8DAC, + CompressedRed = 0x8225, + CompressedRg = 0x8226, + CompressedRgb = 0x84ED, + CompressedRgba = 0x84EE, + CompressedSrgb = 0x8C48, + CompressedSrgbAlpha = 0x8C49, + CompressedRedRgtc1 = 0x8DBB, + CompressedRedRgtc1EXT = 0x8DBB, + CompressedSignedRedRgtc1 = 0x8DBC, + CompressedSignedRedRgtc1EXT = 0x8DBC, + CompressedR11Eac = 0x9270, + CompressedSignedR11Eac = 0x9271, + CompressedRgRgtc2 = 0x8DBD, + CompressedSignedRgRgtc2 = 0x8DBE, + CompressedRgbaBptcUnorm = 0x8E8C, + CompressedSrgbAlphaBptcUnorm = 0x8E8D, + CompressedRgbBptcSignedFloat = 0x8E8E, + CompressedRgbBptcUnsignedFloat = 0x8E8F, + CompressedRgb8Etc2 = 0x9274, + CompressedSrgb8Etc2 = 0x9275, + CompressedRgb8PunchthroughAlpha1Etc2 = 0x9276, + CompressedSrgb8PunchthroughAlpha1Etc2 = 0x9277, + CompressedRgba8Etc2Eac = 0x9278, + CompressedSrgb8Alpha8Etc2Eac = 0x9279, + CompressedRg11Eac = 0x9272, + CompressedSignedRg11Eac = 0x9273, + CompressedRgbS3tcDxt1EXT = 0x83F0, + CompressedSrgbS3tcDxt1EXT = 0x8C4C, + CompressedRgbaS3tcDxt1EXT = 0x83F1, + CompressedSrgbAlphaS3tcDxt1EXT = 0x8C4D, + CompressedRgbaS3tcDxt3EXT = 0x83F2, + CompressedSrgbAlphaS3tcDxt3EXT = 0x8C4E, + CompressedRgbaS3tcDxt5EXT = 0x83F3, + CompressedSrgbAlphaS3tcDxt5EXT = 0x8C4F, + } + + public enum PixelMap + { + PixelMapAToA = 0x0C79, + PixelMapBToB = 0x0C78, + PixelMapGToG = 0x0C77, + PixelMapIToA = 0x0C75, + PixelMapIToB = 0x0C74, + PixelMapIToG = 0x0C73, + PixelMapIToI = 0x0C70, + PixelMapIToR = 0x0C72, + PixelMapRToR = 0x0C76, + PixelMapSToS = 0x0C71, + } + + public enum PixelStoreParameter + { + PackAlignment = 0x0D05, + PackImageDepthSgis = 0x8131, + PackImageHeight = 0x806C, + PackImageHeightEXT = 0x806C, + PackLsbFirst = 0x0D01, + PackResampleOML = 0x8984, + PackResampleSGIX = 0x842E, + PackRowLength = 0x0D02, + PackSkipImages = 0x806B, + PackSkipImagesEXT = 0x806B, + PackSkipPixels = 0x0D04, + PackSkipRows = 0x0D03, + PackSkipVolumesSgis = 0x8130, + PackSubsampleRateSGIX = 0x85A0, + PackSwapBytes = 0x0D00, + PixelTileCacheSizeSGIX = 0x8145, + PixelTileGridDepthSGIX = 0x8144, + PixelTileGridHeightSGIX = 0x8143, + PixelTileGridWidthSGIX = 0x8142, + PixelTileHeightSGIX = 0x8141, + PixelTileWidthSGIX = 0x8140, + UnpackAlignment = 0x0CF5, + UnpackImageDepthSgis = 0x8133, + UnpackImageHeight = 0x806E, + UnpackImageHeightEXT = 0x806E, + UnpackLsbFirst = 0x0CF1, + UnpackResampleOML = 0x8985, + UnpackResampleSGIX = 0x842F, + UnpackRowLength = 0x0CF2, + UnpackRowLengthEXT = 0x0CF2, + UnpackSkipImages = 0x806D, + UnpackSkipImagesEXT = 0x806D, + UnpackSkipPixels = 0x0CF4, + UnpackSkipPixelsEXT = 0x0CF4, + UnpackSkipRows = 0x0CF3, + UnpackSkipRowsEXT = 0x0CF3, + UnpackSkipVolumesSgis = 0x8132, + UnpackSubsampleRateSGIX = 0x85A1, + UnpackSwapBytes = 0x0CF0, + } + + public enum PixelStoreResampleMode + { + ResampleDecimateSGIX = 0x8430, + ResampleReplicateSGIX = 0x8433, + ResampleZeroFillSGIX = 0x8434, + } + + public enum PixelStoreSubsampleRate + { + PixelSubsample2424SGIX = 0x85A3, + PixelSubsample4242SGIX = 0x85A4, + PixelSubsample4444SGIX = 0x85A2, + } + + public enum PixelTexGenMode + { + Luminance = 0x1909, + LuminanceAlpha = 0x190A, + None = 0, + PixelTexGenAlphaLsSGIX = 0x8189, + PixelTexGenAlphaMSSGIX = 0x818A, + PixelTexGenAlphaNoReplaceSGIX = 0x8188, + PixelTexGenAlphaReplaceSGIX = 0x8187, + Rgb = 0x1907, + Rgba = 0x1908, + } + + public enum PixelTexGenParameterNameSGIS + { + PixelFragmentAlphaSourceSgis = 0x8355, + PixelFragmentRgbSourceSgis = 0x8354, + } + + public enum PixelTransferParameter + { + AlphaBias = 0x0D1D, + AlphaScale = 0x0D1C, + BlueBias = 0x0D1B, + BlueScale = 0x0D1A, + DepthBias = 0x0D1F, + DepthScale = 0x0D1E, + GreenBias = 0x0D19, + GreenScale = 0x0D18, + IndexOffset = 0x0D13, + IndexShift = 0x0D12, + MapColor = 0x0D10, + MapStencil = 0x0D11, + PostColorMatrixAlphaBias = 0x80BB, + PostColorMatrixAlphaBiasSGI = 0x80BB, + PostColorMatrixAlphaScale = 0x80B7, + PostColorMatrixAlphaScaleSGI = 0x80B7, + PostColorMatrixBlueBias = 0x80BA, + PostColorMatrixBlueBiasSGI = 0x80BA, + PostColorMatrixBlueScale = 0x80B6, + PostColorMatrixBlueScaleSGI = 0x80B6, + PostColorMatrixGreenBias = 0x80B9, + PostColorMatrixGreenBiasSGI = 0x80B9, + PostColorMatrixGreenScale = 0x80B5, + PostColorMatrixGreenScaleSGI = 0x80B5, + PostColorMatrixRedBias = 0x80B8, + PostColorMatrixRedBiasSGI = 0x80B8, + PostColorMatrixRedScale = 0x80B4, + PostColorMatrixRedScaleSGI = 0x80B4, + PostConvolutionAlphaBias = 0x8023, + PostConvolutionAlphaBiasEXT = 0x8023, + PostConvolutionAlphaScale = 0x801F, + PostConvolutionAlphaScaleEXT = 0x801F, + PostConvolutionBlueBias = 0x8022, + PostConvolutionBlueBiasEXT = 0x8022, + PostConvolutionBlueScale = 0x801E, + PostConvolutionBlueScaleEXT = 0x801E, + PostConvolutionGreenBias = 0x8021, + PostConvolutionGreenBiasEXT = 0x8021, + PostConvolutionGreenScale = 0x801D, + PostConvolutionGreenScaleEXT = 0x801D, + PostConvolutionRedBias = 0x8020, + PostConvolutionRedBiasEXT = 0x8020, + PostConvolutionRedScale = 0x801C, + PostConvolutionRedScaleEXT = 0x801C, + RedBias = 0x0D15, + RedScale = 0x0D14, + } + + public enum PixelType + { + Bitmap = 0x1A00, + Byte = 0x1400, + Float = 0x1406, + Int = 0x1404, + Short = 0x1402, + UnsignedByte = 0x1401, + UnsignedByte332 = 0x8032, + UnsignedByte332EXT = 0x8032, + UnsignedInt = 0x1405, + UnsignedInt1010102 = 0x8036, + UnsignedInt1010102EXT = 0x8036, + UnsignedInt8888 = 0x8035, + UnsignedInt8888EXT = 0x8035, + UnsignedShort = 0x1403, + UnsignedShort4444 = 0x8033, + UnsignedShort4444EXT = 0x8033, + UnsignedShort5551 = 0x8034, + UnsignedShort5551EXT = 0x8034, + } + + public enum PointParameterNameSGIS + { + DistanceAttenuationEXT = 0x8129, + DistanceAttenuationSgis = 0x8129, + PointDistanceAttenuation = 0x8129, + PointDistanceAttenuationARB = 0x8129, + PointFadeThresholdSize = 0x8128, + PointFadeThresholdSizeARB = 0x8128, + PointFadeThresholdSizeEXT = 0x8128, + PointFadeThresholdSizeSgis = 0x8128, + PointSizeMax = 0x8127, + PointSizeMaxARB = 0x8127, + PointSizeMaxEXT = 0x8127, + PointSizeMaxSgis = 0x8127, + PointSizeMin = 0x8126, + PointSizeMinARB = 0x8126, + PointSizeMinEXT = 0x8126, + PointSizeMinSgis = 0x8126, + } + + public enum PolygonMode + { + Fill = 0x1B02, + Line = 0x1B01, + Point = 0x1B00, + } + + public enum PrimitiveType + { + Lines = 0x0001, + LinesAdjacency = 0x000A, + LinesAdjacencyARB = 0x000A, + LinesAdjacencyEXT = 0x000A, + LineLoop = 0x0002, + LineStrip = 0x0003, + LineStripAdjacency = 0x000B, + LineStripAdjacencyARB = 0x000B, + LineStripAdjacencyEXT = 0x000B, + Patches = 0x000E, + PatchesEXT = 0x000E, + Points = 0x0000, + Polygon = 0x0009, + Quads = 0x0007, + QuadsEXT = 0x0007, + QuadStrip = 0x0008, + Triangles = 0x0004, + TrianglesAdjacency = 0x000C, + TrianglesAdjacencyARB = 0x000C, + TrianglesAdjacencyEXT = 0x000C, + TriangleFan = 0x0006, + TriangleStrip = 0x0005, + TriangleStripAdjacency = 0x000D, + TriangleStripAdjacencyARB = 0x000D, + TriangleStripAdjacencyEXT = 0x000D, + } + + public enum ReadBufferMode + { + Aux0 = 0x0409, + Aux1 = 0x040A, + Aux2 = 0x040B, + Aux3 = 0x040C, + Back = 0x0405, + BackLeft = 0x0402, + BackRight = 0x0403, + Front = 0x0404, + FrontLeft = 0x0400, + FrontRight = 0x0401, + Left = 0x0406, + Right = 0x0407, + } + + public enum RenderingMode + { + Feedback = 0x1C01, + Render = 0x1C00, + Select = 0x1C02, + } + + public enum SamplePatternSGIS + { + pattern1passEXT = 0x80A1, + pattern1passSgis = 0x80A1, + pattern2pass0EXT = 0x80A2, + pattern2pass0Sgis = 0x80A2, + pattern2pass1EXT = 0x80A3, + pattern2pass1Sgis = 0x80A3, + pattern4pass0EXT = 0x80A4, + pattern4pass0Sgis = 0x80A4, + pattern4pass1EXT = 0x80A5, + pattern4pass1Sgis = 0x80A5, + pattern4pass2EXT = 0x80A6, + pattern4pass2Sgis = 0x80A6, + pattern4pass3EXT = 0x80A7, + pattern4pass3Sgis = 0x80A7, + } + + public enum SemaphoreParameterName + { + D3d12FenceValueEXT = 0x9595, + } + + public enum SeparableTargetEXT + { + Separable2D = 0x8012, + Separable2DEXT = 0x8012, + } + + public enum ShadingModel + { + Flat = 0x1D00, + Smooth = 0x1D01, + } + + public enum StencilFaceDirection + { + Front = 0x0404, + Back = 0x0405, + FrontAndBack = 0x0408, + } + + public enum StencilFunction + { + Always = 0x0207, + Equal = 0x0202, + Gequal = 0x0206, + Greater = 0x0204, + Lequal = 0x0203, + Less = 0x0201, + Never = 0x0200, + Notequal = 0x0205, + } + + public enum StencilOp + { + Decr = 0x1E03, + DecrWrap = 0x8508, + Incr = 0x1E02, + IncrWrap = 0x8507, + Invert = 0x150A, + Keep = 0x1E00, + Replace = 0x1E01, + Zero = 0, + } + + public enum StringName + { + Extensions = 0x1F03, + Renderer = 0x1F01, + Vendor = 0x1F00, + Version = 0x1F02, + ShadingLanguageVersion = 0x8B8C, + } + + public enum TexCoordPointerType + { + Double = 0x140A, + Float = 0x1406, + Int = 0x1404, + Short = 0x1402, + } + + public enum TextureCoordName + { + S = 0x2000, + T = 0x2001, + R = 0x2002, + Q = 0x2003, + } + + public enum TextureEnvMode + { + Add = 0x0104, + Blend = 0x0BE2, + Decal = 0x2101, + Modulate = 0x2100, + ReplaceEXT = 0x8062, + TextureEnvBiasSGIX = 0x80BE, + } + + public enum TextureEnvParameter + { + TextureEnvColor = 0x2201, + TextureEnvMode = 0x2200, + } + + public enum TextureEnvTarget + { + TextureEnv = 0x2300, + } + + public enum TextureFilterFuncSGIS + { + Filter4Sgis = 0x8146, + } + + public enum TextureGenMode + { + EyeDistanceToLineSgis = 0x81F2, + EyeDistanceToPointSgis = 0x81F0, + EyeLinear = 0x2400, + ObjectDistanceToLineSgis = 0x81F3, + ObjectDistanceToPointSgis = 0x81F1, + ObjectLinear = 0x2401, + SphereMap = 0x2402, + } + + public enum TextureGenParameter + { + EyeLineSgis = 0x81F6, + EyePlane = 0x2502, + EyePointSgis = 0x81F4, + ObjectLineSgis = 0x81F7, + ObjectPlane = 0x2501, + ObjectPointSgis = 0x81F5, + TextureGenMode = 0x2500, + } + + public enum TextureMagFilter + { + Filter4Sgis = 0x8146, + Linear = 0x2601, + LinearDetailAlphaSgis = 0x8098, + LinearDetailColorSgis = 0x8099, + LinearDetailSgis = 0x8097, + LinearSharpenAlphaSgis = 0x80AE, + LinearSharpenColorSgis = 0x80AF, + LinearSharpenSgis = 0x80AD, + Nearest = 0x2600, + PixelTexGenQCeilingSGIX = 0x8184, + PixelTexGenQFloorSGIX = 0x8186, + PixelTexGenQRoundSGIX = 0x8185, + } + + public enum TextureMinFilter + { + Filter4Sgis = 0x8146, + Linear = 0x2601, + LinearClipmapLinearSGIX = 0x8170, + LinearClipmapNearestSGIX = 0x844F, + LinearMipmapLinear = 0x2703, + LinearMipmapNearest = 0x2701, + Nearest = 0x2600, + NearestClipmapLinearSGIX = 0x844E, + NearestClipmapNearestSGIX = 0x844D, + NearestMipmapLinear = 0x2702, + NearestMipmapNearest = 0x2700, + PixelTexGenQCeilingSGIX = 0x8184, + PixelTexGenQFloorSGIX = 0x8186, + PixelTexGenQRoundSGIX = 0x8185, + } + + public enum TextureParameterName + { + DetailTextureLevelSgis = 0x809A, + DetailTextureModeSgis = 0x809B, + DualTextureSelectSgis = 0x8124, + GenerateMipmap = 0x8191, + GenerateMipmapSgis = 0x8191, + PostTextureFilterBiasSGIX = 0x8179, + PostTextureFilterScaleSGIX = 0x817A, + QuadTextureSelectSgis = 0x8125, + ShadowAmbientSGIX = 0x80BF, + TextureBorderColor = 0x1004, + TextureClipmapCenterSGIX = 0x8171, + TextureClipmapDepthSGIX = 0x8176, + TextureClipmapFrameSGIX = 0x8172, + TextureClipmapLodOffsetSGIX = 0x8175, + TextureClipmapOffsetSGIX = 0x8173, + TextureClipmapVirtualDepthSGIX = 0x8174, + TextureCompareSGIX = 0x819A, + TextureLodBiasRSGIX = 0x8190, + TextureLodBiasSSGIX = 0x818E, + TextureLodBiasTSGIX = 0x818F, + TextureMagFilter = 0x2800, + TextureMaxClampRSGIX = 0x836B, + TextureMaxClampSSGIX = 0x8369, + TextureMaxClampTSGIX = 0x836A, + TextureMinFilter = 0x2801, + TexturePriority = 0x8066, + TexturePriorityEXT = 0x8066, + TextureWrapQSgis = 0x8137, + TextureWrapR = 0x8072, + TextureWrapREXT = 0x8072, + TextureWrapROES = 0x8072, + TextureWrapS = 0x2802, + TextureWrapT = 0x2803, + TextureBaseLevel = 0x813C, + TextureCompareMode = 0x884C, + TextureCompareFunc = 0x884D, + TextureLodBias = 0x8501, + TextureMinLod = 0x813A, + TextureMaxLod = 0x813B, + TextureMaxLevel = 0x813D, + TextureSwizzleR = 0x8E42, + TextureSwizzleG = 0x8E43, + TextureSwizzleB = 0x8E44, + TextureSwizzleA = 0x8E45, + TextureSwizzleRgba = 0x8E46, + TextureTilingEXT = 0x9580, + DepthStencilTextureMode = 0x90EA, + DetailTextureFuncPointsSgis = 0x809C, + SharpenTextureFuncPointsSgis = 0x80B0, + Texture4dsizeSgis = 0x8136, + TextureAlphaSize = 0x805F, + TextureBaseLevelSgis = 0x813C, + TextureBlueSize = 0x805E, + TextureBorder = 0x1005, + TextureBorderColorNV = 0x1004, + TextureCompareOperatorSGIX = 0x819B, + TextureComponents = 0x1003, + TextureDepthEXT = 0x8071, + TextureFilter4SizeSgis = 0x8147, + TextureGequalRSGIX = 0x819D, + TextureGreenSize = 0x805D, + TextureHeight = 0x1001, + TextureIntensitySize = 0x8061, + TextureInternalFormat = 0x1003, + TextureLequalRSGIX = 0x819C, + TextureLuminanceSize = 0x8060, + TextureMaxLevelSgis = 0x813D, + TextureMaxLodSgis = 0x813B, + TextureMinLodSgis = 0x813A, + TextureRedSize = 0x805C, + TextureResident = 0x8067, + TextureWidth = 0x1000, + } + + public enum TextureTarget + { + DetailTexture2DSgis = 0x8095, + ProxyTexture1D = 0x8063, + ProxyTexture1DArray = 0x8C19, + ProxyTexture1DArrayEXT = 0x8C19, + ProxyTexture1DEXT = 0x8063, + ProxyTexture2D = 0x8064, + ProxyTexture2DArray = 0x8C1B, + ProxyTexture2DArrayEXT = 0x8C1B, + ProxyTexture2DEXT = 0x8064, + ProxyTexture2DMultisample = 0x9101, + ProxyTexture2DMultisampleArray = 0x9103, + ProxyTexture3D = 0x8070, + ProxyTexture3DEXT = 0x8070, + ProxyTexture4dSgis = 0x8135, + ProxyTextureCubeMap = 0x851B, + ProxyTextureCubeMapARB = 0x851B, + ProxyTextureCubeMapEXT = 0x851B, + ProxyTextureCubeMapArray = 0x900B, + ProxyTextureCubeMapArrayARB = 0x900B, + ProxyTextureRectangle = 0x84F7, + ProxyTextureRectangleARB = 0x84F7, + ProxyTextureRectangleNV = 0x84F7, + Texture1D = 0x0DE0, + Texture2D = 0x0DE1, + Texture3D = 0x806F, + Texture3DEXT = 0x806F, + Texture3DOES = 0x806F, + Texture4dSgis = 0x8134, + TextureRectangle = 0x84F5, + TextureCubeMap = 0x8513, + TextureCubeMapPositiveX = 0x8515, + TextureCubeMapNegativeX = 0x8516, + TextureCubeMapPositiveY = 0x8517, + TextureCubeMapNegativeY = 0x8518, + TextureCubeMapPositiveZ = 0x8519, + TextureCubeMapNegativeZ = 0x851A, + TextureCubeMapArray = 0x9009, + TextureCubeMapArrayARB = 0x9009, + TextureCubeMapArrayEXT = 0x9009, + TextureCubeMapArrayOES = 0x9009, + Texture1DArray = 0x8C18, + Texture2DArray = 0x8C1A, + Texture2DMultisample = 0x9100, + Texture2DMultisampleArray = 0x9102, + } + + public enum TextureWrapMode + { + Clamp = 0x2900, + ClampToBorder = 0x812D, + ClampToBorderARB = 0x812D, + ClampToBorderNV = 0x812D, + ClampToBorderSgis = 0x812D, + ClampToEdge = 0x812F, + ClampToEdgeSgis = 0x812F, + Repeat = 0x2901, + } + + public enum VertexPointerType + { + Double = 0x140A, + Float = 0x1406, + Int = 0x1404, + Short = 0x1402, + } + + public enum FramebufferAttachment + { + MaxColorAttachments = 0x8CDF, + MaxColorAttachmentsEXT = 0x8CDF, + MaxColorAttachmentsNV = 0x8CDF, + ColorAttachment0 = 0x8CE0, + ColorAttachment0EXT = 0x8CE0, + ColorAttachment0NV = 0x8CE0, + ColorAttachment0OES = 0x8CE0, + ColorAttachment1 = 0x8CE1, + ColorAttachment1EXT = 0x8CE1, + ColorAttachment1NV = 0x8CE1, + ColorAttachment2 = 0x8CE2, + ColorAttachment2EXT = 0x8CE2, + ColorAttachment2NV = 0x8CE2, + ColorAttachment3 = 0x8CE3, + ColorAttachment3EXT = 0x8CE3, + ColorAttachment3NV = 0x8CE3, + ColorAttachment4 = 0x8CE4, + ColorAttachment4EXT = 0x8CE4, + ColorAttachment4NV = 0x8CE4, + ColorAttachment5 = 0x8CE5, + ColorAttachment5EXT = 0x8CE5, + ColorAttachment5NV = 0x8CE5, + ColorAttachment6 = 0x8CE6, + ColorAttachment6EXT = 0x8CE6, + ColorAttachment6NV = 0x8CE6, + ColorAttachment7 = 0x8CE7, + ColorAttachment7EXT = 0x8CE7, + ColorAttachment7NV = 0x8CE7, + ColorAttachment8 = 0x8CE8, + ColorAttachment8EXT = 0x8CE8, + ColorAttachment8NV = 0x8CE8, + ColorAttachment9 = 0x8CE9, + ColorAttachment9EXT = 0x8CE9, + ColorAttachment9NV = 0x8CE9, + ColorAttachment10 = 0x8CEA, + ColorAttachment10EXT = 0x8CEA, + ColorAttachment10NV = 0x8CEA, + ColorAttachment11 = 0x8CEB, + ColorAttachment11EXT = 0x8CEB, + ColorAttachment11NV = 0x8CEB, + ColorAttachment12 = 0x8CEC, + ColorAttachment12EXT = 0x8CEC, + ColorAttachment12NV = 0x8CEC, + ColorAttachment13 = 0x8CED, + ColorAttachment13EXT = 0x8CED, + ColorAttachment13NV = 0x8CED, + ColorAttachment14 = 0x8CEE, + ColorAttachment14EXT = 0x8CEE, + ColorAttachment14NV = 0x8CEE, + ColorAttachment15 = 0x8CEF, + ColorAttachment15EXT = 0x8CEF, + ColorAttachment15NV = 0x8CEF, + ColorAttachment16 = 0x8CF0, + ColorAttachment17 = 0x8CF1, + ColorAttachment18 = 0x8CF2, + ColorAttachment19 = 0x8CF3, + ColorAttachment20 = 0x8CF4, + ColorAttachment21 = 0x8CF5, + ColorAttachment22 = 0x8CF6, + ColorAttachment23 = 0x8CF7, + ColorAttachment24 = 0x8CF8, + ColorAttachment25 = 0x8CF9, + ColorAttachment26 = 0x8CFA, + ColorAttachment27 = 0x8CFB, + ColorAttachment28 = 0x8CFC, + ColorAttachment29 = 0x8CFD, + ColorAttachment30 = 0x8CFE, + ColorAttachment31 = 0x8CFF, + DepthAttachment = 0x8D00, + DepthStencilAttachment = 0x821A, + DepthAttachmentEXT = 0x8D00, + DepthAttachmentOES = 0x8D00, + } + + public enum RenderbufferTarget + { + Renderbuffer = 0x8D41, + } + + public enum FramebufferTarget + { + Framebuffer = 0x8D40, + DrawFramebuffer = 0x8CA9, + ReadFramebuffer = 0x8CA8, + } + + public enum TextureUnit + { + Texture0 = 0x84C0, + Texture1 = 0x84C1, + Texture2 = 0x84C2, + Texture3 = 0x84C3, + Texture4 = 0x84C4, + Texture5 = 0x84C5, + Texture6 = 0x84C6, + Texture7 = 0x84C7, + Texture8 = 0x84C8, + Texture9 = 0x84C9, + Texture10 = 0x84CA, + Texture11 = 0x84CB, + Texture12 = 0x84CC, + Texture13 = 0x84CD, + Texture14 = 0x84CE, + Texture15 = 0x84CF, + Texture16 = 0x84D0, + Texture17 = 0x84D1, + Texture18 = 0x84D2, + Texture19 = 0x84D3, + Texture20 = 0x84D4, + Texture21 = 0x84D5, + Texture22 = 0x84D6, + Texture23 = 0x84D7, + Texture24 = 0x84D8, + Texture25 = 0x84D9, + Texture26 = 0x84DA, + Texture27 = 0x84DB, + Texture28 = 0x84DC, + Texture29 = 0x84DD, + Texture30 = 0x84DE, + Texture31 = 0x84DF, + } + + public enum TypeEnum + { + QueryWait = 0x8E13, + QueryNoWait = 0x8E14, + QueryByRegionWait = 0x8E15, + QueryByRegionNoWait = 0x8E16, + } + + public enum FragmentOpATI + { + MovATI = 0x8961, + AddATI = 0x8963, + MulATI = 0x8964, + SubATI = 0x8965, + Dot3ATI = 0x8966, + Dot4ATI = 0x8967, + MadATI = 0x8968, + LerpATI = 0x8969, + CndATI = 0x896A, + Cnd0ATI = 0x896B, + Dot2AddATI = 0x896C, + } + + public enum FramebufferStatus + { + FramebufferComplete = 0x8CD5, + FramebufferUndefined = 0x8219, + FramebufferIncompleteAttachment = 0x8CD6, + FramebufferIncompleteMissingAttachment = 0x8CD7, + FramebufferIncompleteDrawBuffer = 0x8CDB, + FramebufferIncompleteReadBuffer = 0x8CDC, + FramebufferUnsupported = 0x8CDD, + FramebufferIncompleteMultisample = 0x8D56, + FramebufferIncompleteLayerTargets = 0x8DA8, + } + + public enum GraphicsResetStatus + { + NoError = 0, + GuiltyContextReset = 0x8253, + InnocentContextReset = 0x8254, + UnknownContextReset = 0x8255, + } + + public enum SyncStatus + { + AlreadySignaled = 0x911A, + TimeoutExpired = 0x911B, + ConditionSatisfied = 0x911C, + WaitFailed = 0x911D, + } + + public enum QueryTarget + { + SamplesPassed = 0x8914, + AnySamplesPassed = 0x8C2F, + AnySamplesPassedConservative = 0x8D6A, + PrimitivesGenerated = 0x8C87, + TransformFeedbackPrimitivesWritten = 0x8C88, + TimeElapsed = 0x88BF, + } + + public enum QueryCounterTarget + { + Timestamp = 0x8E28, + } + + public enum ConvolutionTarget + { + Convolution1D = 0x8010, + Convolution2D = 0x8011, + } + + public enum PathFillMode + { + Invert = 0x150A, + CountUpNV = 0x9088, + CountDownNV = 0x9089, + PathFillModeNV = 0x9080, + } + + public enum ColorTableTarget + { + ColorTable = 0x80D0, + PostConvolutionColorTable = 0x80D1, + PostColorMatrixColorTable = 0x80D2, + } + + public enum VertexBufferObjectParameter + { + BufferAccess = 0x88BB, + BufferAccessFlags = 0x911F, + BufferImmutableStorage = 0x821F, + BufferMapped = 0x88BC, + BufferMapLength = 0x9120, + BufferMapOffset = 0x9121, + BufferSize = 0x8764, + BufferStorageFlags = 0x8220, + BufferUsage = 0x8765, + } + + public enum RenderbufferParameterName + { + RenderbufferWidth = 0x8D42, + RenderbufferHeight = 0x8D43, + RenderbufferInternalFormat = 0x8D44, + RenderbufferSamples = 0x8CAB, + RenderbufferRedSize = 0x8D50, + RenderbufferGreenSize = 0x8D51, + RenderbufferBlueSize = 0x8D52, + RenderbufferAlphaSize = 0x8D53, + RenderbufferDepthSize = 0x8D54, + RenderbufferStencilSize = 0x8D55, + } + + public enum VertexBufferObjectUsage + { + StreamDraw = 0x88E0, + StreamRead = 0x88E1, + StreamCopy = 0x88E2, + StaticDraw = 0x88E4, + StaticRead = 0x88E5, + StaticCopy = 0x88E6, + DynamicDraw = 0x88E8, + DynamicRead = 0x88E9, + DynamicCopy = 0x88EA, + } + + public enum FramebufferParameterName + { + FramebufferDefaultWidth = 0x9310, + FramebufferDefaultHeight = 0x9311, + FramebufferDefaultLayers = 0x9312, + FramebufferDefaultSamples = 0x9313, + FramebufferDefaultFixedSampleLocations = 0x9314, + } + + public enum ProgramParameterPName + { + ProgramBinaryRetrievableHint = 0x8257, + ProgramSeparable = 0x8258, + } + + public enum BlendingFactor + { + Zero = 0, + One = 1, + SrcColor = 0x0300, + OneMinusSrcColor = 0x0301, + DstColor = 0x0306, + OneMinusDstColor = 0x0307, + SrcAlpha = 0x0302, + OneMinusSrcAlpha = 0x0303, + DstAlpha = 0x0304, + OneMinusDstAlpha = 0x0305, + ConstantColor = 0x8001, + OneMinusConstantColor = 0x8002, + ConstantAlpha = 0x8003, + OneMinusConstantAlpha = 0x8004, + SrcAlphaSaturate = 0x0308, + Src1Color = 0x88F9, + OneMinusSrc1Color = 0x88FA, + Src1Alpha = 0x8589, + OneMinusSrc1Alpha = 0x88FB, + } + + public enum BindTransformFeedbackTarget + { + TransformFeedback = 0x8E22, + } + + public enum BlitFramebufferFilter + { + Nearest = 0x2600, + Linear = 0x2601, + } + + public enum BufferStorageTarget + { + ArrayBuffer = 0x8892, + AtomicCounterBuffer = 0x92C0, + CopyReadBuffer = 0x8F36, + CopyWriteBuffer = 0x8F37, + DispatchIndirectBuffer = 0x90EE, + DrawIndirectBuffer = 0x8F3F, + ElementArrayBuffer = 0x8893, + PixelPackBuffer = 0x88EB, + PixelUnpackBuffer = 0x88EC, + QueryBuffer = 0x9192, + ShaderStorageBuffer = 0x90D2, + TextureBuffer = 0x8C2A, + TransformFeedbackBuffer = 0x8C8E, + UniformBuffer = 0x8A11, + } + + public enum CheckFramebufferStatusTarget + { + DrawFramebuffer = 0x8CA9, + ReadFramebuffer = 0x8CA8, + Framebuffer = 0x8D40, + } + + public enum Buffer + { + Color = 0x1800, + Depth = 0x1801, + Stencil = 0x1802, + } + + public enum ClipControlOrigin + { + LowerLeft = 0x8CA1, + UpperLeft = 0x8CA2, + } + + public enum ClipControlDepth + { + NegativeOneToOne = 0x935E, + ZeroToOne = 0x935F, + } + + public enum CopyBufferSubDataTarget + { + ArrayBuffer = 0x8892, + AtomicCounterBuffer = 0x92C0, + CopyReadBuffer = 0x8F36, + CopyWriteBuffer = 0x8F37, + DispatchIndirectBuffer = 0x90EE, + DrawIndirectBuffer = 0x8F3F, + ElementArrayBuffer = 0x8893, + PixelPackBuffer = 0x88EB, + PixelUnpackBuffer = 0x88EC, + QueryBuffer = 0x9192, + ShaderStorageBuffer = 0x90D2, + TextureBuffer = 0x8C2A, + TransformFeedbackBuffer = 0x8C8E, + UniformBuffer = 0x8A11, + } + + public enum DebugSource + { + DebugSourceApi = 0x8246, + DebugSourceWindowSystem = 0x8247, + DebugSourceShaderCompiler = 0x8248, + DebugSourceThirdParty = 0x8249, + DebugSourceApplication = 0x824A, + DebugSourceOther = 0x824B, + DontCare = 0x1100, + } + + public enum DebugType + { + DebugTypeError = 0x824C, + DebugTypeDeprecatedBehavior = 0x824D, + DebugTypeUndefinedBehavior = 0x824E, + DebugTypePortability = 0x824F, + DebugTypePerformance = 0x8250, + DebugTypeMarker = 0x8268, + DebugTypePushGroup = 0x8269, + DebugTypePopGroup = 0x826A, + DebugTypeOther = 0x8251, + DontCare = 0x1100, + } + + public enum DebugSeverity + { + DebugSeverityLow = 0x9148, + DebugSeverityMedium = 0x9147, + DebugSeverityHigh = 0x9146, + DebugSeverityNotification = 0x826B, + DontCare = 0x1100, + } + + public enum SyncCondition + { + SyncGpuCommandsComplete = 0x9117, + } + + public enum FogPName + { + FogMode = 0x0B65, + FogDensity = 0x0B62, + FogStart = 0x0B63, + FogEnd = 0x0B64, + FogIndex = 0x0B61, + FogCoordSrc = 0x8450, + } + + public enum AtomicCounterBufferPName + { + AtomicCounterBufferBinding = 0x92C1, + AtomicCounterBufferDataSize = 0x92C4, + AtomicCounterBufferActiveAtomicCounters = 0x92C5, + AtomicCounterBufferActiveAtomicCounterIndices = 0x92C6, + AtomicCounterBufferReferencedByVertexShader = 0x92C7, + AtomicCounterBufferReferencedByTessControlShader = 0x92C8, + AtomicCounterBufferReferencedByTessEvaluationShader = 0x92C9, + AtomicCounterBufferReferencedByGeometryShader = 0x92CA, + AtomicCounterBufferReferencedByFragmentShader = 0x92CB, + AtomicCounterBufferReferencedByComputeShader = 0x90ED, + } + + public enum UniformBlockPName + { + UniformBlockBinding = 0x8A3F, + UniformBlockDataSize = 0x8A40, + UniformBlockNameLength = 0x8A41, + UniformBlockActiveUniforms = 0x8A42, + UniformBlockActiveUniformIndices = 0x8A43, + UniformBlockReferencedByVertexShader = 0x8A44, + UniformBlockReferencedByTessControlShader = 0x84F0, + UniformBlockReferencedByTessEvaluationShader = 0x84F1, + UniformBlockReferencedByGeometryShader = 0x8A45, + UniformBlockReferencedByFragmentShader = 0x8A46, + UniformBlockReferencedByComputeShader = 0x90EC, + } + + public enum UniformPName + { + UniformType = 0x8A37, + UniformSize = 0x8A38, + UniformNameLength = 0x8A39, + UniformBlockIndex = 0x8A3A, + UniformOffset = 0x8A3B, + UniformArrayStride = 0x8A3C, + UniformMatrixStride = 0x8A3D, + UniformIsRowMajor = 0x8A3E, + UniformAtomicCounterBufferIndex = 0x92DA, + } + + public enum SamplerParameterName + { + TextureWrapS = 0x2802, + TextureWrapT = 0x2803, + TextureWrapR = 0x8072, + TextureMinFilter = 0x2801, + TextureMagFilter = 0x2800, + TextureBorderColor = 0x1004, + TextureMinLod = 0x813A, + TextureMaxLod = 0x813B, + TextureCompareMode = 0x884C, + TextureCompareFunc = 0x884D, + } + + public enum VertexProvokingMode + { + FirstVertexConvention = 0x8E4D, + LastVertexConvention = 0x8E4E, + } + + public enum PatchParameterName + { + PatchVertices = 0x8E72, + PatchDefaultOuterLevel = 0x8E74, + PatchDefaultInnerLevel = 0x8E73, + } + + public enum ObjectIdentifier + { + Buffer = 0x82E0, + Shader = 0x82E1, + Program = 0x82E2, + VertexArray = 0x8074, + Query = 0x82E3, + ProgramPipeline = 0x82E4, + TransformFeedback = 0x8E22, + Sampler = 0x82E6, + Texture = 0x1702, + Renderbuffer = 0x8D41, + Framebuffer = 0x8D40, + } + + public enum ColorBuffer + { + None = 0, + FrontLeft = 0x0400, + FrontRight = 0x0401, + BackLeft = 0x0402, + BackRight = 0x0403, + Front = 0x0404, + Back = 0x0405, + Left = 0x0406, + Right = 0x0407, + FrontAndBack = 0x0408, + ColorAttachment0 = 0x8CE0, + ColorAttachment1 = 0x8CE1, + ColorAttachment2 = 0x8CE2, + ColorAttachment3 = 0x8CE3, + ColorAttachment4 = 0x8CE4, + ColorAttachment5 = 0x8CE5, + ColorAttachment6 = 0x8CE6, + ColorAttachment7 = 0x8CE7, + ColorAttachment8 = 0x8CE8, + ColorAttachment9 = 0x8CE9, + ColorAttachment10 = 0x8CEA, + ColorAttachment11 = 0x8CEB, + ColorAttachment12 = 0x8CEC, + ColorAttachment13 = 0x8CED, + ColorAttachment14 = 0x8CEE, + ColorAttachment15 = 0x8CEF, + ColorAttachment16 = 0x8CF0, + ColorAttachment17 = 0x8CF1, + ColorAttachment18 = 0x8CF2, + ColorAttachment19 = 0x8CF3, + ColorAttachment20 = 0x8CF4, + ColorAttachment21 = 0x8CF5, + ColorAttachment22 = 0x8CF6, + ColorAttachment23 = 0x8CF7, + ColorAttachment24 = 0x8CF8, + ColorAttachment25 = 0x8CF9, + ColorAttachment26 = 0x8CFA, + ColorAttachment27 = 0x8CFB, + ColorAttachment28 = 0x8CFC, + ColorAttachment29 = 0x8CFD, + ColorAttachment30 = 0x8CFE, + ColorAttachment31 = 0x8CFF, + } + + public enum MapQuery + { + Coeff = 0x0A00, + Order = 0x0A01, + Domain = 0x0A02, + } + + public enum VertexArrayPName + { + VertexAttribArrayEnabled = 0x8622, + VertexAttribArraySize = 0x8623, + VertexAttribArrayStride = 0x8624, + VertexAttribArrayType = 0x8625, + VertexAttribArrayNormalized = 0x886A, + VertexAttribArrayInteger = 0x88FD, + VertexAttribArrayLong = 0x874E, + VertexAttribArrayDivisor = 0x88FE, + VertexAttribRelativeOffset = 0x82D5, + } + + public enum TransformFeedbackPName + { + TransformFeedbackBufferBinding = 0x8C8F, + TransformFeedbackBufferStart = 0x8C84, + TransformFeedbackBufferSize = 0x8C85, + TransformFeedbackPaused = 0x8E23, + TransformFeedbackActive = 0x8E24, + } + + public enum SyncParameterName + { + ObjectType = 0x9112, + SyncStatus = 0x9114, + SyncCondition = 0x9113, + SyncFlags = 0x9115, + } + + public enum ShaderParameterName + { + ShaderType = 0x8B4F, + DeleteStatus = 0x8B80, + CompileStatus = 0x8B81, + InfoLogLength = 0x8B84, + ShaderSourceLength = 0x8B88, + } + + public enum QueryObjectParameterName + { + QueryResultAvailable = 0x8867, + QueryResult = 0x8866, + QueryResultNoWait = 0x9194, + QueryTarget = 0x82EA, + } + + public enum QueryParameterName + { + CurrentQuery = 0x8865, + QueryCounterBits = 0x8864, + } + + public enum ProgramStagePName + { + ActiveSubroutineUniforms = 0x8DE6, + ActiveSubroutineUniformLocations = 0x8E47, + ActiveSubroutines = 0x8DE5, + ActiveSubroutineUniformMaxLength = 0x8E49, + ActiveSubroutineMaxLength = 0x8E48, + } + + public enum PipelineParameterName + { + ActiveProgram = 0x8259, + VertexShader = 0x8B31, + TessControlShader = 0x8E88, + TessEvaluationShader = 0x8E87, + GeometryShader = 0x8DD9, + FragmentShader = 0x8B30, + InfoLogLength = 0x8B84, + } + + public enum ProgramInterface + { + Uniform = 0x92E1, + UniformBlock = 0x92E2, + ProgramInput = 0x92E3, + ProgramOutput = 0x92E4, + VertexSubroutine = 0x92E8, + TessControlSubroutine = 0x92E9, + TessEvaluationSubroutine = 0x92EA, + GeometrySubroutine = 0x92EB, + FragmentSubroutine = 0x92EC, + ComputeSubroutine = 0x92ED, + VertexSubroutineUniform = 0x92EE, + TessControlSubroutineUniform = 0x92EF, + TessEvaluationSubroutineUniform = 0x92F0, + GeometrySubroutineUniform = 0x92F1, + FragmentSubroutineUniform = 0x92F2, + ComputeSubroutineUniform = 0x92F3, + TransformFeedbackVarying = 0x92F4, + TransformFeedbackBuffer = 0x8C8E, + BufferVariable = 0x92E5, + ShaderStorageBlock = 0x92E6, + } + + public enum VertexAttribEnum + { + VertexAttribArrayBufferBinding = 0x889F, + VertexAttribArrayEnabled = 0x8622, + VertexAttribArraySize = 0x8623, + VertexAttribArrayStride = 0x8624, + VertexAttribArrayType = 0x8625, + VertexAttribArrayNormalized = 0x886A, + VertexAttribArrayInteger = 0x88FD, + VertexAttribArrayDivisor = 0x88FE, + CurrentVertexAttrib = 0x8626, + } + + public enum VertexAttribType + { + Byte = 0x1400, + Short = 0x1402, + Int = 0x1404, + Fixed = 0x140C, + Float = 0x1406, + HalfFloat = 0x140B, + Double = 0x140A, + UnsignedByte = 0x1401, + UnsignedShort = 0x1403, + UnsignedInt = 0x1405, + Int2101010Rev = 0x8D9F, + UnsignedInt2101010Rev = 0x8368, + UnsignedInt10f11f11fRev = 0x8C3B, + } + + public enum InternalFormatPName + { + NumSampleCounts = 0x9380, + Samples = 0x80A9, + InternalformatSupported = 0x826F, + InternalformatPreferred = 0x8270, + InternalformatRedSize = 0x8271, + InternalformatGreenSize = 0x8272, + InternalformatBlueSize = 0x8273, + InternalformatAlphaSize = 0x8274, + InternalformatDepthSize = 0x8275, + InternalformatStencilSize = 0x8276, + InternalformatSharedSize = 0x8277, + InternalformatRedType = 0x8278, + InternalformatGreenType = 0x8279, + InternalformatBlueType = 0x827A, + InternalformatAlphaType = 0x827B, + InternalformatDepthType = 0x827C, + InternalformatStencilType = 0x827D, + MaxWidth = 0x827E, + MaxHeight = 0x827F, + MaxDepth = 0x8280, + MaxLayers = 0x8281, + ColorComponents = 0x8283, + ColorRenderable = 0x8286, + DepthRenderable = 0x8287, + StencilRenderable = 0x8288, + FramebufferRenderable = 0x8289, + FramebufferRenderableLayered = 0x828A, + FramebufferBlend = 0x828B, + ReadPixels = 0x828C, + ReadPixelsFormat = 0x828D, + ReadPixelsType = 0x828E, + TextureImageFormat = 0x828F, + TextureImageType = 0x8290, + GetTextureImageFormat = 0x8291, + GetTextureImageType = 0x8292, + Mipmap = 0x8293, + GenerateMipmap = 0x8191, + AutoGenerateMipmap = 0x8295, + ColorEncoding = 0x8296, + SrgbRead = 0x8297, + SrgbWrite = 0x8298, + Filter = 0x829A, + VertexTexture = 0x829B, + TessControlTexture = 0x829C, + TessEvaluationTexture = 0x829D, + GeometryTexture = 0x829E, + FragmentTexture = 0x829F, + ComputeTexture = 0x82A0, + TextureShadow = 0x82A1, + TextureGather = 0x82A2, + TextureGatherShadow = 0x82A3, + ShaderImageLoad = 0x82A4, + ShaderImageStore = 0x82A5, + ShaderImageAtomic = 0x82A6, + ImageTexelSize = 0x82A7, + ImageCompatibilityClass = 0x82A8, + ImagePixelFormat = 0x82A9, + ImagePixelType = 0x82AA, + ImageFormatCompatibilityType = 0x90C7, + SimultaneousTextureAndDepthTest = 0x82AC, + SimultaneousTextureAndStencilTest = 0x82AD, + SimultaneousTextureAndDepthWrite = 0x82AE, + SimultaneousTextureAndStencilWrite = 0x82AF, + TextureCompressed = 0x86A1, + TextureCompressedBlockWidth = 0x82B1, + TextureCompressedBlockHeight = 0x82B2, + TextureCompressedBlockSize = 0x82B3, + ClearBuffer = 0x82B4, + TextureView = 0x82B5, + ViewCompatibilityClass = 0x82B6, + ClearTexture = 0x9365, + } + + public enum FramebufferAttachmentParameterName + { + FramebufferAttachmentRedSize = 0x8212, + FramebufferAttachmentGreenSize = 0x8213, + FramebufferAttachmentBlueSize = 0x8214, + FramebufferAttachmentAlphaSize = 0x8215, + FramebufferAttachmentDepthSize = 0x8216, + FramebufferAttachmentStencilSize = 0x8217, + FramebufferAttachmentComponentType = 0x8211, + FramebufferAttachmentColorEncoding = 0x8210, + FramebufferAttachmentObjectName = 0x8CD1, + FramebufferAttachmentTextureLevel = 0x8CD2, + FramebufferAttachmentTextureCubeMapFace = 0x8CD3, + FramebufferAttachmentLayered = 0x8DA7, + FramebufferAttachmentTextureLayer = 0x8CD4, + } + + public enum ProgramInterfacePName + { + ActiveResources = 0x92F5, + MaxNameLength = 0x92F6, + MaxNumActiveVariables = 0x92F7, + MaxNumCompatibleSubroutines = 0x92F8, + } + + public enum PrecisionType + { + LowFloat = 0x8DF0, + MediumFloat = 0x8DF1, + HighFloat = 0x8DF2, + LowInt = 0x8DF3, + MediumInt = 0x8DF4, + HighInt = 0x8DF5, + } + + public enum VertexAttribPointerType + { + Byte = 0x1400, + UnsignedByte = 0x1401, + Short = 0x1402, + UnsignedShort = 0x1403, + Int = 0x1404, + UnsignedInt = 0x1405, + Float = 0x1406, + Double = 0x140A, + HalfFloat = 0x140B, + Fixed = 0x140C, + Int2101010Rev = 0x8D9F, + UnsignedInt2101010Rev = 0x8368, + UnsignedInt10f11f11fRev = 0x8C3B, + } + + public enum SubroutineParameterName + { + NumCompatibleSubroutines = 0x8E4A, + CompatibleSubroutines = 0x8E4B, + UniformSize = 0x8A38, + UniformNameLength = 0x8A39, + } + + public enum GetFramebufferParameter + { + FramebufferDefaultWidth = 0x9310, + FramebufferDefaultHeight = 0x9311, + FramebufferDefaultLayers = 0x9312, + FramebufferDefaultSamples = 0x9313, + FramebufferDefaultFixedSampleLocations = 0x9314, + Doublebuffer = 0x0C32, + ImplementationColorReadFormat = 0x8B9B, + ImplementationColorReadType = 0x8B9A, + Samples = 0x80A9, + SampleBuffers = 0x80A8, + Stereo = 0x0C33, + } + + public enum PathStringFormat + { + PathFormatSvgNV = 0x9070, + PathFormatPsNV = 0x9071, + } + + public enum PathFontTarget + { + StandardFontNameNV = 0x9072, + SystemFontNameNV = 0x9073, + FileNameNV = 0x9074, + } + + public enum PathHandleMissingGlyphs + { + SkipMissingGlyphNV = 0x90A9, + UseMissingGlyphNV = 0x90AA, + } + + public enum PathParameter + { + PathStrokeWidthNV = 0x9075, + PathInitialEndCapNV = 0x9077, + PathTerminalEndCapNV = 0x9078, + PathJoinStyleNV = 0x9079, + PathMiterLimitNV = 0x907A, + PathInitialDashCapNV = 0x907C, + PathTerminalDashCapNV = 0x907D, + PathDashOffsetNV = 0x907E, + PathClientLengthNV = 0x907F, + PathDashOffsetResetNV = 0x90B4, + PathFillModeNV = 0x9080, + PathFillMaskNV = 0x9081, + PathFillCoverModeNV = 0x9082, + PathStrokeCoverModeNV = 0x9083, + PathStrokeMaskNV = 0x9084, + PathEndCapsNV = 0x9076, + PathDashCapsNV = 0x907B, + PathCommandCountNV = 0x909D, + PathCoordCountNV = 0x909E, + PathDashArrayCountNV = 0x909F, + PathComputedLengthNV = 0x90A0, + PathObjectBoundingBoxNV = 0x908A, + PathFillBoundingBoxNV = 0x90A1, + PathStrokeBoundingBoxNV = 0x90A2, + } + + public enum PathColor + { + PrimaryColor = 0x8577, + PrimaryColorNV = 0x852C, + SecondaryColorNV = 0x852D, + } + + public enum PathGenMode + { + None = 0, + EyeLinear = 0x2400, + ObjectLinear = 0x2401, + PathObjectBoundingBoxNV = 0x908A, + Constant = 0x8576, + } + + public enum TextureLayout + { + LayoutGeneralEXT = 0x958D, + LayoutColorAttachmentEXT = 0x958E, + LayoutDepthStencilAttachmentEXT = 0x958F, + LayoutDepthStencilReadOnlyEXT = 0x9590, + LayoutShaderReadOnlyEXT = 0x9591, + LayoutTransferSrcEXT = 0x9592, + LayoutTransferDstEXT = 0x9593, + LayoutDepthReadOnlyStencilAttachmentEXT = 0x9530, + LayoutDepthAttachmentStencilReadOnlyEXT = 0x9531, + } + + public enum PathTransformType + { + None = 0, + TranslateXNV = 0x908E, + TranslateYNV = 0x908F, + Translate2DNV = 0x9090, + Translate3DNV = 0x9091, + Affine2DNV = 0x9092, + Affine3DNV = 0x9094, + TransposeAffine2DNV = 0x9096, + TransposeAffine3DNV = 0x9098, + } + + public enum PathElementType + { + Utf8NV = 0x909A, + Utf16NV = 0x909B, + } + + public enum PathCoverMode + { + ConvexHullNV = 0x908B, + BoundingBoxNV = 0x908D, + BoundingBoxOfBoundingBoxesNV = 0x909C, + PathFillCoverModeNV = 0x9082, + } + + public enum PathFontStyle + { + None = 0, + BoldBitNV = 0x01, + ItalicBitNV = 0x02, + } + + public enum PathMetricMask + { + GlyphWidthBitNV = 0x01, + GlyphHeightBitNV = 0x02, + GlyphHorizontalBearingXBitNV = 0x04, + GlyphHorizontalBearingYBitNV = 0x08, + GlyphHorizontalBearingAdvanceBitNV = 0x10, + GlyphVerticalBearingXBitNV = 0x20, + GlyphVerticalBearingYBitNV = 0x40, + GlyphVerticalBearingAdvanceBitNV = 0x80, + GlyphHasKerningBitNV = 0x100, + FontXMinBoundsBitNV = 0x00010000, + FontYMinBoundsBitNV = 0x00020000, + FontXMaxBoundsBitNV = 0x00040000, + FontYMaxBoundsBitNV = 0x00080000, + FontUnitsPerEmBitNV = 0x00100000, + FontAscenderBitNV = 0x00200000, + FontDescenderBitNV = 0x00400000, + FontHeightBitNV = 0x00800000, + FontMaxAdvanceWidthBitNV = 0x01000000, + FontMaxAdvanceHeightBitNV = 0x02000000, + FontUnderlinePositionBitNV = 0x04000000, + FontUnderlineThicknessBitNV = 0x08000000, + FontHasKerningBitNV = 0x10000000, + FontNumGlyphIndicesBitNV = 0x20000000, + } + + public enum PathListMode + { + AccumAdjacentPairsNV = 0x90AD, + AdjacentPairsNV = 0x90AE, + FirstToRestNV = 0x90AF, + } + + public enum ProgramPropertyARB + { + DeleteStatus = 0x8B80, + LinkStatus = 0x8B82, + ValidateStatus = 0x8B83, + InfoLogLength = 0x8B84, + AttachedShaders = 0x8B85, + ActiveAtomicCounterBuffers = 0x92D9, + ActiveAttributes = 0x8B89, + ActiveAttributeMaxLength = 0x8B8A, + ActiveUniforms = 0x8B86, + ActiveUniformBlocks = 0x8A36, + ActiveUniformBlockMaxNameLength = 0x8A35, + ActiveUniformMaxLength = 0x8B87, + ComputeWorkGroupSize = 0x8267, + ProgramBinaryLength = 0x8741, + TransformFeedbackBufferMode = 0x8C7F, + TransformFeedbackVaryings = 0x8C83, + TransformFeedbackVaryingMaxLength = 0x8C76, + GeometryVerticesOut = 0x8916, + GeometryInputType = 0x8917, + GeometryOutputType = 0x8918, + } +} diff --git a/src/SlatedGameToolkit.Framework/Graphics/Programs/GLProgram.cs b/src/SlatedGameToolkit.Framework/Graphics/Programs/GLProgram.cs deleted file mode 100644 index 3413fd8..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Programs/GLProgram.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Numerics; -using System.Runtime.InteropServices; -using System.Text; -using SDL2; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics; -using SlatedGameToolkit.Framework.Graphics.Window; - -namespace SlatedGameToolkit.Framework.Graphics.Programs -{ - /// - /// Represents a GL Program. - /// This class is abstract and serves as a parent to the possible types of programs. - /// Gives access to common OpenGL program associated function calls. - /// - public abstract class GLProgram : IDisposable - { - private WindowContext context; - protected readonly UIntPtr handle; - protected GLCreateProgram createProgram; - protected GLDeleteProgram deleteProgram; - protected GLLinkProgram linkProgram; - protected GLGetProgramInfoLog getProgramInfoLog; - protected GLProgramParameter programParameter; - private GLUseProgram useProgram; - private readonly GLGetAttribLocation getAttribLocation; - private readonly GLGetUniformLocation getUniformLocation; - private readonly GLUniformMatrix4fv uniformMatrix4Fv; - - - /// - /// Creates an OpenGL program. - /// - /// This is bound to the current context. - /// - internal GLProgram() { - this.context = WindowContextsManager.CurrentWindowContext; - createProgram = OpenGL.RetrieveGLDelegate("glCreateProgram"); - deleteProgram = OpenGL.RetrieveGLDelegate("glDeleteProgram"); - linkProgram = OpenGL.RetrieveGLDelegate("glLinkProgram"); - getProgramInfoLog = OpenGL.RetrieveGLDelegate("glGetProgramInfoLog"); - programParameter = OpenGL.RetrieveGLDelegate("glProgramParameteri"); - useProgram = OpenGL.RetrieveGLDelegate("glUseProgram"); - getAttribLocation = OpenGL.RetrieveGLDelegate("glGetAttribLocation"); - getUniformLocation = OpenGL.RetrieveGLDelegate("glGetUniformLocation"); - uniformMatrix4Fv = OpenGL.RetrieveGLDelegate("glUniformMatrix4fv"); - - handle = createProgram(); - OpenGLErrorException.CheckGLErrorStatus(); - } - - - public int GetAttributeLocation(string name) { - int res = getAttribLocation(handle, name); - OpenGLErrorException.CheckGLErrorStatus(); - return res; - } - - public int GetUniformLocation(string name) { - int res = getUniformLocation(handle, name); - OpenGLErrorException.CheckGLErrorStatus(); - return res; - } - - public void SetUniformMatrix4x4(int location, Matrix4x4 matrix, bool transpose = false) { - Use(); - float[] mat4 = new float[] { - matrix.M11, matrix.M21, matrix.M31, matrix.M41, - matrix.M21, matrix.M22, matrix.M23, matrix.M24, - matrix.M31, matrix.M32, matrix.M33, matrix.M34, - matrix.M41, matrix.M42, matrix.M43, matrix.M44 - }; - uniformMatrix4Fv(location, 1, transpose, mat4); - OpenGLErrorException.CheckGLErrorStatus(); - } - - /// - /// Binds this program. - /// - public virtual void Use() { - useProgram(handle); - uint written; - byte[] log = new byte[2048]; - getProgramInfoLog(handle, (uint)log.Length, out written, log); - if (written > 0) { - throw new OpenGLException(Encoding.UTF8.GetString(log)); - } - OpenGLErrorException.CheckGLErrorStatus(); - } - - /// - /// Disposes of the program. - /// - public virtual void Dispose() - { - deleteProgram(handle); - OpenGLErrorException.CheckGLErrorStatus(); - } - - ~GLProgram() { - Dispose(); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Programs/GLShaderProgram.cs b/src/SlatedGameToolkit.Framework/Graphics/Programs/GLShaderProgram.cs deleted file mode 100644 index 9a46d16..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Programs/GLShaderProgram.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Text; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics; -using SlatedGameToolkit.Framework.Graphics.Shaders; - -namespace SlatedGameToolkit.Framework.Graphics.Programs -{ - public class GLShaderProgram : GLProgram - { - private readonly GLShader[] shaders; - private readonly GLAttachShader attachShader; - private readonly GLDetachShader detachShader; - public GLShaderProgram(params GLShader[] shaders) : base() { - if (shaders.Length == 0) throw new ArgumentException("Requires at least one shader for shader program."); - this.shaders = shaders; - - attachShader = OpenGL.RetrieveGLDelegate("glAttachShader"); - detachShader = OpenGL.RetrieveGLDelegate("glDetachShader"); - - - foreach (GLShader shader in shaders) - { - attachShader(handle, shader.Handle); - OpenGLErrorException.CheckGLErrorStatus(); - } - - linkProgram(handle); - uint length; - byte[] log = new byte[2048]; - getProgramInfoLog(handle, (uint)log.Length, out length, log); - if (length > 0) { - Dispose(); - throw new OpenGLException(Encoding.UTF8.GetString(log)); - } - OpenGLErrorException.CheckGLErrorStatus(); - - foreach (GLShader shader in shaders) - { - detachShader(handle, shader.Handle); - OpenGLErrorException.CheckGLErrorStatus(); - } - } - - - /// - /// Disposes of the shaders and this program. - /// - public override void Dispose() { - foreach (GLShader shader in shaders) - { - shader.Dispose(); - } - base.Dispose(); - } - - ~GLShaderProgram() { - Dispose(); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Batch.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Batch.cs deleted file mode 100644 index 0e63711..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Render/Batch.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Drawing; -using System.Numerics; -using SlatedGameToolkit.Framework.Graphics.Meshes; -using SlatedGameToolkit.Framework.Graphics; -using SlatedGameToolkit.Framework.Graphics.Textures; -using SlatedGameToolkit.Framework.Graphics.Shaders; -using SlatedGameToolkit.Framework.Graphics.Programs; -using SlatedGameToolkit.Framework.Exceptions; - -namespace SlatedGameToolkit.Framework.Graphics.Render -{ - public class Batch : IDisposable { - private int projLoc, viewLoc, modelLoc; - private Camera camera; - private GLShaderProgram shaderProgram; - private Texture texture; - private bool disposed; - private VertexArray vertexArray; - private const int VERTEX_LENGTH = 9; - private GLMultiDrawElements multiDrawElements; - public bool Batching { get; private set; } - - private Matrix4x4 modelsMatrix; - private float[] data; - private uint[] indices; - private uint[] lengths; - private uint[] offsets; - private uint dataIndex, indicesIndex, lengthsIndex; - - public Batch(Camera camera, GLShaderProgram shaderProgram, uint BatchVertexSize = 4096) { - multiDrawElements = OpenGL.RetrieveGLDelegate("glMultiDrawElements"); - this.camera = camera; - this.shaderProgram = shaderProgram; - indices = new uint[BatchVertexSize]; - lengths = new uint[BatchVertexSize]; - offsets = new uint[BatchVertexSize]; - data = new float[BatchVertexSize * VERTEX_LENGTH]; - vertexArray = new VertexArray(); - GLGetAttribLocation attribLocation = OpenGL.RetrieveGLDelegate("glGetAttribLocation"); - VertexAttributeDefinition[] definitions = new VertexAttributeDefinition[3]; - definitions[0] = new VertexAttributeDefinition((uint)shaderProgram.GetAttributeLocation("aPosition"), 3, 3 * sizeof(float), 0); - definitions[1] = new VertexAttributeDefinition((uint)shaderProgram.GetAttributeLocation("aColor"), 4, 4 * sizeof(float), 3 * sizeof(float)); - definitions[2] = new VertexAttributeDefinition((uint)shaderProgram.GetAttributeLocation("aTexCoord"), 2, 2 * sizeof(float), (4 + 3) * sizeof(float)); - modelLoc = shaderProgram.GetUniformLocation("models"); - viewLoc = shaderProgram.GetUniformLocation("view"); - projLoc = shaderProgram.GetUniformLocation("projection"); - vertexArray.defineVertexAttributes(definitions: definitions); - } - - public virtual void Begin(Texture texture, Matrix4x4 modelsMatrix) { - if (Batching) throw new InvalidOperationException("This batch is already started."); - this.texture = texture ?? throw new ArgumentNullException("texture"); - this.Batching = true; - this.modelsMatrix = modelsMatrix; - } - - public virtual void Dispose() - { - if (disposed) return; - if (Batching) End(); - disposed = true; - vertexArray.Dispose(); - } - - public virtual void Add(IMeshable meshable, Color color) { - ValueTuple[] vertices = meshable.Vertices; - uint[] indices = meshable.Elements; - if (vertices.Length * VERTEX_LENGTH + dataIndex >= data.Length || indices.Length + indicesIndex >= indicesIndex) Flush(); - for (int i = 0; i < vertices.Length; i++) { - data[dataIndex] = vertices[i].Item1.X; - dataIndex++; - data[dataIndex] = vertices[i].Item1.Y; - dataIndex++; - data[dataIndex] = vertices[i].Item1.Z; - dataIndex++; - - data[dataIndex] = (float) color.A / byte.MaxValue; - dataIndex++; - data[dataIndex] = (float) color.R / byte.MaxValue; - dataIndex++; - data[dataIndex] = (float) color.G / byte.MaxValue; - dataIndex++; - data[dataIndex] = (float) color.B / byte.MaxValue; - dataIndex++; - - data[dataIndex] = vertices[i].Item2.X; - dataIndex++; - data[dataIndex] = vertices[i].Item2.Y; - dataIndex++; - - uint elementsCount = (uint)indices.Length; - Array.Copy(indices, indices, elementsCount); - indicesIndex += elementsCount; - - lengths[lengthsIndex] = elementsCount; - lengthsIndex ++; - } - } - - public virtual void End() { - if (!Batching) throw new InvalidOperationException("This batch was never started."); - this.Batching = false; - Flush(); - } - - protected virtual void Flush() { - texture.Use(); - vertexArray.Use(); - vertexArray.BufferVertices(data); - vertexArray.BufferIndices(indices); - dataIndex = 0; - indicesIndex = 0; - lengthsIndex = 0; - shaderProgram.SetUniformMatrix4x4(modelLoc, modelsMatrix); - shaderProgram.SetUniformMatrix4x4(viewLoc, camera.ViewMatrix); - shaderProgram.SetUniformMatrix4x4(projLoc, camera.ProjectionMatrix); - multiDrawElements(GLEnum.GL_TRIANGLE_STRIP, lengths, GLEnum.GL_UNSIGNED_INT, offsets, lengths.Length); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Camera.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Camera.cs index 74bc458..016418d 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Render/Camera.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Camera.cs @@ -1,36 +1,53 @@ +using System; using System.Numerics; +using SlatedGameToolkit.Framework.Utilities; namespace SlatedGameToolkit.Framework.Graphics.Render { public class Camera { - private bool viewUpdated, projectionUpdated; - public virtual Vector3 Up { get; set; } - private Vector3 trans, lookAt; - private float nearField, farField; + private bool viewUpdated = true, projectionUpdated = true, orthographic; + public virtual Vector3 Up { get; set; } = Vector3.UnitY; + private Vector3 position, lookAt; + private float nearField = 0.01f, farField = 100f; private float width, height; - private Matrix4x4 lookAtMatrix; - private Matrix4x4 view, projection; - public virtual bool Orthographic { get; set; } - - public virtual Vector3 Position { + private Matrix4x4 lookAtMatrix = Matrix4x4.Identity; + private Matrix4x4 view = Matrix4x4.Identity, projection; + public bool Orthographic { get { - return trans; - } - + return orthographic; + } + set { - this.trans = value; + orthographic = value; + projectionUpdated = true; + } + } + + public Vector3 Position { + get { + return position; + } + set { + this.position = value; viewUpdated = true; } } + public Vector3 CameraFront { + get { + return (LookAt - Position).NormalizeSafe(default(Vector3)); + } + set { + LookAt = (position + value.NormalizeSafe(default(Vector3))); + } + } + public Vector3 LookAt { get { return lookAt; } - set { this.lookAt = value; - lookAtMatrix = Matrix4x4.CreateLookAt(-trans, value, Up); viewUpdated = true; } } @@ -61,10 +78,10 @@ namespace SlatedGameToolkit.Framework.Graphics.Render get { return width; } - set { - width = value; - projectionUpdated = true; - } + set { + width = value; + projectionUpdated = true; + } } public virtual float Height { get { @@ -79,7 +96,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render public Matrix4x4 ViewMatrix { get { if (viewUpdated) { - view = Matrix4x4.CreateTranslation(-trans) * lookAtMatrix; + view = Matrix4x4.CreateLookAt(Position, LookAt, Up); viewUpdated = false; } return view; @@ -99,5 +116,14 @@ namespace SlatedGameToolkit.Framework.Graphics.Render return projection; } } + + public Camera(float width, float height) { + if (width <= 0) throw new ArgumentException("Width can't be less than or equal to 0."); + if (height <= 0) throw new ArgumentException("Height can't be less than or equal to 0."); + this.Width = width; + this.Height = height; + this.Position = new Vector3(0, 0, 3); + this.CameraFront = -Vector3.UnitZ; + } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Camera2D.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Camera2D.cs index a54058d..83ac06a 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Render/Camera2D.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Camera2D.cs @@ -9,14 +9,13 @@ namespace SlatedGameToolkit.Framework.Graphics.Render } set { - base.Position = new Vector3(value, 0); + base.Position = new Vector3(value, base.Position.Z); + base.CameraFront = -Vector3.UnitZ; } } - public Camera2D() { + public Camera2D(int width, int height) : base(width, height) { this.Orthographic = true; - this.Up = Vector3.UnitY; - this.LookAt = new Vector3(0, 0, 1); } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/IRenderable.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/IRenderable.cs deleted file mode 100644 index a26f383..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Render/IRenderable.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Drawing; -using SlatedGameToolkit.Framework.Graphics.Meshes; -using SlatedGameToolkit.Framework.Graphics.Textures; - -namespace SlatedGameToolkit.Framework.Graphics.Render -{ - public interface IRenderable : IMeshable - { - Texture Texture { get; } - Color Color { get; } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/MeshBatch.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/MeshBatch.cs new file mode 100644 index 0000000..43951c6 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/MeshBatch.cs @@ -0,0 +1,166 @@ +using System; +using System.Drawing; +using System.Numerics; +using SlatedGameToolkit.Framework.Graphics.Meshes; +using SlatedGameToolkit.Framework.Graphics.OpenGL; +using SlatedGameToolkit.Framework.Graphics.Render.Programs; +using SlatedGameToolkit.Framework.Graphics.Render.Shaders; +using SlatedGameToolkit.Framework.Graphics.Textures; +using SlatedGameToolkit.Framework.Graphics.Window; +using SlatedGameToolkit.Framework.Utilities; + +namespace SlatedGameToolkit.Framework.Graphics.Render +{ + public class MeshBatch : IDisposable { + public GLContext GLContext {get; private set; } + private const int VERTEX_LENGTH = 9; + private int projLoc, viewLoc, modelLoc; + private Camera camera; + private RenderProgram renderProgram; + private Texture texture; + private Texture fillerTexture; + private bool disposed; + private VertexArrayBuffers vertexBuffers; + public bool Batching { get; private set; } + + private Matrix4x4 modelsMatrix; + private float[] data; + private uint[] indices; + private int[] lengths; + private int[] indiceOffsets; + private int[] verticeOffsets; + private int dataIndex, indicesIndex, offsetIndex; + + public MeshBatch(Camera camera, RenderProgram renderProgram = null, uint BatchVertexSize = 4096) { + if (renderProgram == null) { + VertexShader vert = new VertexShader(EmbeddedResourceUtils.ReadEmbeddedResourceText("default.vert")); + FragmentShader frag = new FragmentShader(EmbeddedResourceUtils.ReadEmbeddedResourceText("default.frag")); + renderProgram = new RenderProgram(null, vert, frag); + } + this.renderProgram = renderProgram; + this.GLContext = renderProgram.GLContext; + this.camera = camera; + indices = new uint[BatchVertexSize]; + lengths = new int[BatchVertexSize]; + indiceOffsets = new int[BatchVertexSize]; + data = new float[BatchVertexSize * VERTEX_LENGTH]; + verticeOffsets = new int[BatchVertexSize]; + vertexBuffers = new VertexArrayBuffers(GLContext); + VertexAttributeDefinition[] definitions = new VertexAttributeDefinition[3]; + definitions[0] = new VertexAttributeDefinition((uint)GLContext.GetAttribLocation(renderProgram.Handle, "aPosition"), 3); + definitions[1] = new VertexAttributeDefinition((uint)GLContext.GetAttribLocation(renderProgram.Handle, "aColor"), 4); + definitions[2] = new VertexAttributeDefinition((uint)GLContext.GetAttribLocation(renderProgram.Handle, "aTexCoord"), 2); + renderProgram.Use(); + modelLoc = GLContext.GetUniformLocation(renderProgram.Handle, "models"); + viewLoc = GLContext.GetUniformLocation(renderProgram.Handle, "view"); + projLoc = GLContext.GetUniformLocation(renderProgram.Handle, "projection"); + vertexBuffers.defineVertexAttributes(definitions: definitions); + + fillerTexture = new Texture(GameEngine.FillerTextureData); + } + + public virtual void Begin(Matrix4x4 modelsMatrix) { + if (Batching) throw new InvalidOperationException("This batch is already started."); + this.Batching = true; + this.modelsMatrix = modelsMatrix; + } + + public virtual void Draw(IMeshable meshable) { + if (meshable.Texture != this.texture) { + if (this.texture != null) { + Flush(); + } + this.texture = meshable.Texture ?? fillerTexture; + } + ValueTuple[] vertices = meshable.Vertices; + uint[] indices = meshable.Elements; + if (vertices.Length * VERTEX_LENGTH + dataIndex >= data.Length || indices.Length + indicesIndex >= this.indices.Length) + Flush(); + for (int i = 0; i < vertices.Length; i++) { + data[dataIndex] = vertices[i].Item1.X; + dataIndex++; + data[dataIndex] = vertices[i].Item1.Y; + dataIndex++; + data[dataIndex] = vertices[i].Item1.Z; + dataIndex++; + + data[dataIndex] = meshable.Color.RedAsFloat(); + dataIndex++; + data[dataIndex] = meshable.Color.GreenAsFloat(); + dataIndex++; + data[dataIndex] = meshable.Color.BlueAsFloat(); + dataIndex++; + data[dataIndex] = meshable.Color.AlphaAsFloat(); + dataIndex++; + + data[dataIndex] = vertices[i].Item2.X; + dataIndex++; + data[dataIndex] = vertices[i].Item2.Y; + dataIndex++; + } + int elementsCount = indices.Length; + Array.Copy(indices, 0, this.indices, indicesIndex, elementsCount); + indicesIndex += elementsCount; + if (offsetIndex + 1 < verticeOffsets.Length) { + verticeOffsets[offsetIndex + 1] = verticeOffsets[offsetIndex] + vertices.Length; + indiceOffsets[offsetIndex + 1] = indicesIndex * sizeof(int); + } + lengths[offsetIndex] = elementsCount; + offsetIndex++; + } + + public virtual void End() { + if (!Batching) throw new InvalidOperationException("This batch was never started."); + this.Batching = false; + Flush(); + } + + protected virtual void Flush() { + texture.Use(); + renderProgram.Use(); + vertexBuffers.BufferVertices(data, true); + vertexBuffers.BufferIndices(indices, true); + GLContext.UniformMatrix4fv(modelLoc, 1, false, modelsMatrix.ToColumnMajorArray()); + GLContext.UniformMatrix4fv(viewLoc, 1, false, camera.ViewMatrix.ToColumnMajorArray()); + GLContext.UniformMatrix4fv(projLoc, 1, false, camera.ProjectionMatrix.ToColumnMajorArray()); + // GLContext.UniformMatrix4fv(modelLoc, 1, false, Matrix4x4.Identity.ToColumnMajorArray()); + // GLContext.UniformMatrix4fv(viewLoc, 1, false, Matrix4x4.Identity.ToColumnMajorArray()); + // GLContext.UniformMatrix4fv(projLoc, 1, false, Matrix4x4.Identity.ToColumnMajorArray()); + GLContext.MultiDrawElementsBaseVertex(PrimitiveType.Triangles, lengths, DrawElementsType.UnsignedInt, indiceOffsets, offsetIndex, verticeOffsets); + dataIndex = 0; + indicesIndex = 0; + offsetIndex = 0; + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + } + if (disposed) return; + if (Batching) End(); + disposed = true; + vertexBuffers.Dispose(); + renderProgram.Dispose(); + fillerTexture.Dispose(); + data = null; + indices = null; + lengths = null; + verticeOffsets = null; + } + } + + ~MeshBatch() + { + Dispose(disposing: false); + } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Programs/RenderProgram.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Programs/RenderProgram.cs new file mode 100644 index 0000000..2b097d7 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Programs/RenderProgram.cs @@ -0,0 +1,70 @@ +using System; +using System.Text; +using SlatedGameToolkit.Framework.Exceptions; +using SlatedGameToolkit.Framework.Graphics.OpenGL; +using SlatedGameToolkit.Framework.Graphics.Render.Shaders; +using SlatedGameToolkit.Framework.Graphics.Window; + +namespace SlatedGameToolkit.Framework.Graphics.Render.Programs +{ + public class RenderProgram : IDisposable + { + public GLContext GLContext {get; private set; } + private bool disposed; + + public uint Handle { get; private set; } + public RenderProgram(GLContext context = null, params IShadeable[] shaders) { + this.GLContext = context ?? WindowContextsManager.CurrentGL; + Handle = GLContext.CreateProgram(); + foreach (IShadeable shader in shaders) + { + if (this.GLContext != shader.GLContext) throw new FrameworkUsageException("OpenGL contexts between attached shaders and program must match."); + GLContext.AttachShader(Handle, shader.Handle); + } + GLContext.LinkProgram(Handle); + int status; + GLContext.GetProgramiv(Handle, ProgramPropertyARB.LinkStatus, out status); + if ((OpenGL.Boolean)status == OpenGL.Boolean.False) { + int logLength; + GLContext.GetProgramiv(Handle, ProgramPropertyARB.InfoLogLength, out logLength); + byte[] logData = new byte[logLength]; + int byteCount; + GLContext.GetProgramInfoLog(Handle, logLength, out byteCount, logData); + throw new FrameworkUsageException(Encoding.UTF8.GetString(logData)); + } + + foreach (IShadeable shader in shaders) + { + shader.Dispose(); + } + } + + public void Use() { + GLContext.UseProgram(Handle); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + } + + GLContext.DeleteProgram(Handle); + disposed = true; + } + } + + ~RenderProgram() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Renderer.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Renderer.cs deleted file mode 100644 index a538632..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Render/Renderer.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Drawing; -using System.Numerics; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics.Programs; -using SlatedGameToolkit.Framework.Graphics.Textures; - -namespace SlatedGameToolkit.Framework.Graphics.Render -{ - public class Renderer : IDisposable - { - private Batch batch; - private Texture currentTexture; - - public Renderer(Batch batch) { - this.batch = batch; - } - - public Renderer(Camera camera, GLShaderProgram program, uint BatchVertexSize = 4096) { - this.batch = new Batch(camera, program, BatchVertexSize); - } - - public void Dispose() - { - batch.Dispose(); - } - - public void Queue(IRenderable renderable, Matrix4x4 modelsMatrix) { - if (renderable.Texture != currentTexture) { - if (batch.Batching) batch.End(); - currentTexture = renderable.Texture; - batch.Begin(currentTexture, modelsMatrix); - } - batch.Add(renderable, renderable.Color); - } - - public void Render() { - if (batch.Batching) batch.End(); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/FragmentShader.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/FragmentShader.cs new file mode 100644 index 0000000..1c1f997 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/FragmentShader.cs @@ -0,0 +1,57 @@ +using System; +using System.Text; +using SlatedGameToolkit.Framework.Exceptions; +using SlatedGameToolkit.Framework.Graphics.OpenGL; +using SlatedGameToolkit.Framework.Graphics.Window; + +namespace SlatedGameToolkit.Framework.Graphics.Render.Shaders +{ + public class FragmentShader : IShadeable + { + public GLContext GLContext {get; private set; } + private bool disposed; + + public uint Handle { get; private set; } + + public FragmentShader(string program, GLContext context = null) { + this.GLContext = context ?? WindowContextsManager.CurrentGL; + Handle = GLContext.CreateShader(ShaderType.FragmentShader); + GLContext.ShaderSource(Handle, 1, new string[] {program}, null); + GLContext.CompileShader(Handle); + int status; + GLContext.GetShaderiv(Handle, ShaderParameterName.CompileStatus, out status); + if ((OpenGL.Boolean)status == OpenGL.Boolean.False) { + int logLength; + GLContext.GetShaderiv(Handle, ShaderParameterName.InfoLogLength, out logLength); + byte[] logData = new byte[logLength]; + int byteCount; + GLContext.GetShaderInfoLog(Handle, logLength, out byteCount, logData); + throw new FrameworkUsageException(string.Format("Error compiling shader: {0}", Encoding.UTF8.GetString(logData))); + } + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + } + + GLContext.DeleteShader(Handle); + disposed = true; + } + } + + ~FragmentShader() + { + Dispose(disposing: false); + } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/IShadeable.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/IShadeable.cs new file mode 100644 index 0000000..a444e2a --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/IShadeable.cs @@ -0,0 +1,11 @@ +using System; +using SlatedGameToolkit.Framework.Graphics.OpenGL; + +namespace SlatedGameToolkit.Framework.Graphics.Render.Shaders +{ + public interface IShadeable : IDisposable + { + GLContext GLContext {get;} + uint Handle { get; } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/VertexShader.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/VertexShader.cs new file mode 100644 index 0000000..67d64f7 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Shaders/VertexShader.cs @@ -0,0 +1,55 @@ +using System; +using System.Text; +using SlatedGameToolkit.Framework.Exceptions; +using SlatedGameToolkit.Framework.Graphics.OpenGL; +using SlatedGameToolkit.Framework.Graphics.Window; + +namespace SlatedGameToolkit.Framework.Graphics.Render.Shaders +{ + public class VertexShader : IShadeable + { + public GLContext GLContext {get; private set;} + private bool disposed; + + public uint Handle { get; private set; } + + public VertexShader(string program, GLContext context = null) { + this.GLContext = context ?? WindowContextsManager.CurrentGL; + Handle = GLContext.CreateShader(ShaderType.VertexShader); + GLContext.ShaderSource(Handle, 1, new string[] {program}, null); + GLContext.CompileShader(Handle); + int status; + GLContext.GetShaderiv(Handle, ShaderParameterName.CompileStatus, out status); + if ((OpenGL.Boolean)status == OpenGL.Boolean.False) { + int logLength; + GLContext.GetShaderiv(Handle, ShaderParameterName.InfoLogLength, out logLength); + byte[] logData = new byte[logLength]; + int byteCount; + GLContext.GetShaderInfoLog(Handle, logLength, out byteCount, logData); + throw new FrameworkUsageException(string.Format("Error compiling shader: {0}", Encoding.UTF8.GetString(logData))); + } + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + } + GLContext.DeleteShader(Handle); + disposed = true; + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + ~VertexShader() { + Dispose(false); + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Sprite2D.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Sprite2D.cs index 6aff36f..1625018 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Render/Sprite2D.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Sprite2D.cs @@ -4,27 +4,25 @@ using SlatedGameToolkit.Framework.Graphics.Textures; namespace SlatedGameToolkit.Framework.Graphics.Render { - public class Sprite2D : RectangleMesh, IRenderable + public class Sprite2D : RectangleMesh { - public Texture Texture { get; private set; } - - public Color Color { get; private set; } - public Sprite2D(Texture texture, Color color) { this.Texture = texture; - this.textureCoords[0].X = -1; - this.textureCoords[0].Y = -1; + this.textureCoords[0].X = 0; + this.textureCoords[0].Y = 1; this.textureCoords[1].X = 1; - this.textureCoords[1].Y = -1; + this.textureCoords[1].Y = 1; this.textureCoords[2].X = 1; - this.textureCoords[2].Y = 1; + this.textureCoords[2].Y = 0; - this.textureCoords[3].X = -1; - this.textureCoords[3].Y = 1; + this.textureCoords[3].X = 0; + this.textureCoords[3].Y = 0; this.Color = color; + this.Width = 1f; + this.Height = 1f; } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/VertexArrayBuffers.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/VertexArrayBuffers.cs new file mode 100644 index 0000000..0fe0d79 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/VertexArrayBuffers.cs @@ -0,0 +1,123 @@ +using System; +using SlatedGameToolkit.Framework.Graphics.OpenGL; +using SlatedGameToolkit.Framework.Graphics.Window; + +namespace SlatedGameToolkit.Framework.Graphics.Render +{ + /// + /// A set of two buffers, one for the vertices, and one for the indices. Also defines an vertex array that defines the attributes of the buffers. + /// + public class VertexArrayBuffers : IDisposable { + private GLContext glContext; + private bool disposed; + private uint vertexBufferHandle, vertexArrayHandle, indexBufferHandle; + public VertexArrayBuffers(GLContext context) { + this.glContext = context ?? WindowContextsManager.CurrentGL; + + uint[] vertexArrays = new uint[1]; + glContext.GenVertexArrays(1, vertexArrays); + vertexArrayHandle = vertexArrays[0]; + + uint[] vertexBuffers = new uint[2]; + glContext.GenBuffers(2, vertexBuffers); + vertexBufferHandle = vertexBuffers[0]; + indexBufferHandle = vertexBuffers[1]; + } + + public void Use() { + if (disposed) throw new ObjectDisposedException("VertexArrayBuffers"); + glContext.BindVertexArray(vertexArrayHandle); + glContext.BindBuffer(BufferTargetARB.ElementArrayBuffer, indexBufferHandle); + glContext.BindBuffer(BufferTargetARB.ArrayBuffer, vertexBufferHandle); + } + + public unsafe void BufferVertices(float[] data, bool dynamic) { + Use(); + fixed (void* pointer = &data[0]) { + glContext.BufferData(OpenGL.BufferTargetARB.ArrayBuffer, (uint) (sizeof(float) * data.Length), new IntPtr(pointer), dynamic ? OpenGL.BufferUsageARB.DynamicDraw : OpenGL.BufferUsageARB.StaticDraw); + } + } + + public unsafe void BufferIndices(uint[] data, bool dynamic) { + Use(); + fixed (void* pointer = &data[0]) { + glContext.BufferData(OpenGL.BufferTargetARB.ElementArrayBuffer, (uint) (sizeof(uint) * data.Length), new IntPtr(pointer), dynamic ? OpenGL.BufferUsageARB.DynamicDraw : OpenGL.BufferUsageARB.StaticDraw); + } + } + + /// + /// Defines the vertex attributes in an OpenGL vertex array object. + /// Sends as floats. + /// + /// Whether or not to automatically enable the attributes that are being defined. Defaults to true. + /// The definitions for the vertex array object. + public void defineVertexAttributes(bool enableAttributes = true, params VertexAttributeDefinition[] definitions) { + Use(); + int offset = 0; + uint stride = 0; + foreach (VertexAttributeDefinition definition in definitions) + { + stride += (uint)definition.size * sizeof(float); + } + foreach (VertexAttributeDefinition definition in definitions) + { + glContext.VertexAttribPointer(definition.attributeIndex, definition.size, OpenGL.VertexAttribPointerType.Float, false, stride, new IntPtr(offset)); + offset += definition.size * sizeof(float); + if (enableAttributes) glContext.EnableVertexAttribArray(definition.attributeIndex); + } + } + + /// + /// Enaables the vertex array object's definitions at the given attribute indices. + /// + /// The attribute indices to be enabled. + public void EnableAttributes(params uint[] attributeIndices) { + Use(); + foreach (uint attrib in attributeIndices) + { + glContext.EnableVertexAttribArray(attrib); + } + } + + /// + /// Disables the vertex array object's definitions at the given attribute indices. + /// + /// The attribute indices to be disabled. + public void DisableAttributes(params uint[] attributeIndices) { + Use(); + foreach (uint attrib in attributeIndices) + { + glContext.DisableVertexAttribArray(attrib); + } + } + + protected virtual void Dispose(bool disposing) + { + if (this.disposed) return; + if (disposing) { + } + this.disposed = true; + glContext.DeleteVertexArrays(1, new uint[] {vertexArrayHandle}); + glContext.DeleteBuffers(2, new uint[] {indexBufferHandle, vertexBufferHandle}); + } + + public void Dispose() { + Dispose(true); + GC.SuppressFinalize(this); + } + + ~VertexArrayBuffers() { + Dispose(false); + } + } + + public struct VertexAttributeDefinition { + public uint attributeIndex; + public int size; + + public VertexAttributeDefinition(uint attributeIndex, int size) { + this.attributeIndex = attributeIndex; + this.size = size; + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLFragmentShader.cs b/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLFragmentShader.cs deleted file mode 100644 index 407a4ba..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLFragmentShader.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Text; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics; - -namespace SlatedGameToolkit.Framework.Graphics.Shaders -{ - public class GLFragmentShader : GLShader { - - /// - /// Creates an OpenGL fragment shader. - /// - /// A string representing the GLSL code to run. - public GLFragmentShader(string shader) : base() { - Handle = createShader(GLEnum.GL_FRAGMENT_SHADER); - shaderSource(Handle, 1, new string[] {shader}, null); - compileShader(Handle); - uint logLength; - byte[] log = new byte[2048]; - getShaderInfoLog(Handle, (uint)log.Length, out logLength, log); - if (logLength > 0) { - Dispose(); - throw new OpenGLException(Encoding.UTF8.GetString(log)); - } - OpenGLErrorException.CheckGLErrorStatus(); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLShader.cs b/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLShader.cs deleted file mode 100644 index 03d17e9..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLShader.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using SDL2; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics; -using SlatedGameToolkit.Framework.Graphics.Programs; -using SlatedGameToolkit.Framework.Graphics.Window; - -namespace SlatedGameToolkit.Framework.Graphics.Shaders -{ - public abstract class GLShader : IDisposable { - private WindowContext context; - public virtual UIntPtr Handle { get; protected set; } - - protected GLCreateShader createShader; - protected GLShaderSource shaderSource; - protected GLCompileShader compileShader; - protected GLGetShaderInfoLog getShaderInfoLog; - private GLDeleteShader deleteShader; - - public GLShader() { - context = WindowContextsManager.CurrentWindowContext; - createShader = OpenGL.RetrieveGLDelegate("glCreateShader"); - shaderSource = OpenGL.RetrieveGLDelegate("glShaderSource"); - compileShader = OpenGL.RetrieveGLDelegate("glCompileShader"); - getShaderInfoLog = OpenGL.RetrieveGLDelegate("glGetShaderInfoLog"); - deleteShader = OpenGL.RetrieveGLDelegate("glDeleteShader"); - } - - - /// - /// Disposes of the shader at the handle. - /// - public virtual void Dispose() - { - deleteShader(Handle); - OpenGLErrorException.CheckGLErrorStatus(); - } - - ~GLShader() { - Dispose(); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLVertexArraySet.cs b/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLVertexArraySet.cs deleted file mode 100644 index 52001a2..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLVertexArraySet.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics; - -namespace SlatedGameToolkit.Framework.Graphics.Shaders -{ - public sealed class GLVertexArraySet : IDisposable { - private bool disposed; - public int Count { get; private set; } - private UIntPtr[] arrayBufferHandles; - private UIntPtr[] vertexArrayHandles; - private UIntPtr[] indexArrayHandles; - private GLBindBuffer bindBuffer; - private GLGenBuffers genBuffers; - private GLDeleteBuffers deleteBuffers; - private GLGenVertexArrays genVertexArrays; - private GLBindVertexArray bindVertexArray; - private GLDeleteVertexArrays deleteVertexArrays; - private GLVertexAttribPointer vertexAttribPointer; - private GLEnableVertexAttribArray enableVertexAttribArray; - private GLDisableVertexAttribArray disableVertexAttribArray; - private GLBufferData bufferData; - public GLVertexArraySet(uint amount) { - if (amount > int.MaxValue) throw new ArgumentOutOfRangeException("amount"); - this.Count = (int)amount; - genBuffers = OpenGL.RetrieveGLDelegate("glGenBuffers"); - deleteBuffers = OpenGL.RetrieveGLDelegate("glDeleteBuffers"); - bindBuffer = OpenGL.RetrieveGLDelegate("glBindBuffer"); - genVertexArrays = OpenGL.RetrieveGLDelegate("glGenVertexArrays"); - bindVertexArray = OpenGL.RetrieveGLDelegate("glBindVertexArray"); - deleteVertexArrays = OpenGL.RetrieveGLDelegate("glDeleteVertexArrays"); - vertexAttribPointer = OpenGL.RetrieveGLDelegate("glVertexAttribPointer"); - enableVertexAttribArray = OpenGL.RetrieveGLDelegate("glEnableVertexAttribArray"); - disableVertexAttribArray = OpenGL.RetrieveGLDelegate("glDisableVertexAttribArray"); - bufferData = OpenGL.RetrieveGLDelegate("glBufferData"); - arrayBufferHandles = new UIntPtr[amount]; - vertexArrayHandles = new UIntPtr[amount]; - indexArrayHandles = new UIntPtr[amount]; - genBuffers(amount, arrayBufferHandles); - OpenGLErrorException.CheckGLErrorStatus(); - genVertexArrays(amount, vertexArrayHandles); - OpenGLErrorException.CheckGLErrorStatus(); - genBuffers(amount, indexArrayHandles); - OpenGLErrorException.CheckGLErrorStatus(); - } - - public void Use(uint index) { - bindVertexArray(vertexArrayHandles[index]); - OpenGLErrorException.CheckGLErrorStatus(); - bindBuffer(GLEnum.GL_ELEMENT_ARRAY_BUFFER, indexArrayHandles[index]); - bindBuffer(GLEnum.GL_ARRAY_BUFFER, arrayBufferHandles[index]); - OpenGLErrorException.CheckGLErrorStatus(); - } - - public unsafe void BufferVertices(uint index, float[] data, bool dynamic) { - Use(index); - bufferData(GLEnum.GL_ARRAY_BUFFER, (uint) (sizeof(float) * data.Length), data, dynamic ? GLEnum.GL_DYNAMIC_DRAW : GLEnum.GL_STATIC_DRAW); - OpenGLErrorException.CheckGLErrorStatus(); - } - - public unsafe void BufferIndices(uint index, uint[] data, bool dynamic) { - Use(index); - bufferData(GLEnum.GL_ELEMENT_ARRAY_BUFFER, (uint) (sizeof(float) * data.Length), data, dynamic ? GLEnum.GL_DYNAMIC_DRAW : GLEnum.GL_STATIC_DRAW); - OpenGLErrorException.CheckGLErrorStatus(); - } - - /// - /// Defines the vertex attributes in an OpenGL vertex array object. - /// Sends as floats. - /// - /// The buffer in this set to affect. - /// Whether or not to automatically enable the attributes that are being defined. Defaults to true. - /// The definitions for the vertex array object. - public void defineVertexAttributes(uint bufferIndex, bool enableAttributes = true, params VertexAttributeDefinition[] definitions) { - Use(bufferIndex); - foreach (VertexAttributeDefinition definition in definitions) - { - vertexAttribPointer(definition.attributeIndex, definition.size, GLEnum.GL_FLOAT, false, definition.stride, definition.offset); - OpenGLErrorException.CheckGLErrorStatus(); - if (enableAttributes) enableVertexAttribArray(definition.attributeIndex); - } - } - - /// - /// Enaables the vertex array object's definitions at the given attribute indices. - /// - /// The buffer index in this set this should affect. - /// The attribute indices to be enabled. - public void EnableAttributes(uint bufferIndex, params uint[] attributeIndices) { - Use(bufferIndex); - foreach (uint attrib in attributeIndices) - { - enableVertexAttribArray(attrib); - } - } - - /// - /// Disables the vertex array object's definitions at the given attribute indices. - /// - /// The buffer index in this set that should be affected. - /// The attribute indices to be disabled. - public void DisableAttributes(uint bufferIndex, params uint[] attributeIndices) { - Use(bufferIndex); - foreach (uint attrib in attributeIndices) - { - disableVertexAttribArray(attrib); - } - } - - public void Dispose() - { - if (this.disposed) return; - this.disposed = true; - deleteBuffers((uint)arrayBufferHandles.Length, arrayBufferHandles); - OpenGLErrorException.CheckGLErrorStatus(); - deleteVertexArrays((uint)vertexArrayHandles.Length, vertexArrayHandles); - OpenGLErrorException.CheckGLErrorStatus(); - GC.SuppressFinalize(this); - } - - ~GLVertexArraySet() { - Dispose(); - } - } - - public struct VertexAttributeDefinition { - public uint attributeIndex; - public int size; - public uint stride; - public uint offset; - - public VertexAttributeDefinition(uint attributeIndex, int size, uint stride, uint offset) { - this.attributeIndex = attributeIndex; - this.size = size; - this.stride = stride; - this.offset = offset; - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLVertexShader.cs b/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLVertexShader.cs deleted file mode 100644 index 89e0ef9..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Shaders/GLVertexShader.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Text; -using SlatedGameToolkit.Framework.Exceptions; - -namespace SlatedGameToolkit.Framework.Graphics.Shaders -{ - public class GLVertexShader : GLShader { - - /// - /// Creates an OpenGL vertex shader. - /// - /// A string representing the GLSL code. - public GLVertexShader(string shader) : base() { - Handle = createShader(GLEnum.GL_VERTEX_SHADER); - shaderSource(Handle, 1, new string[] {shader}, null); - compileShader(Handle); - uint logLength; - byte[] log = new byte[2048]; - getShaderInfoLog(Handle, (uint)log.Length, out logLength, log); - if (logLength > 0) { - Dispose(); - throw new OpenGLException(Encoding.UTF8.GetString(log)); - } - OpenGLErrorException.CheckGLErrorStatus(); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Shaders/NormalFragmentShader.cs b/src/SlatedGameToolkit.Framework/Graphics/Shaders/NormalFragmentShader.cs deleted file mode 100644 index 3718113..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Shaders/NormalFragmentShader.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.IO; -using System.Reflection; - -namespace SlatedGameToolkit.Framework.Graphics.Shaders -{ - public class NormalFragmentShader : GLShader - { - private GLFragmentShader shader; - public NormalFragmentShader() { - using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SlatedGameToolkit.Framework.Resources.default.frag")) - { - using (StreamReader reader = new StreamReader(stream)) - { - shader = new GLFragmentShader(reader.ReadToEnd()); - } - } - this.Handle = shader.Handle; - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Shaders/NormalVertexShader.cs b/src/SlatedGameToolkit.Framework/Graphics/Shaders/NormalVertexShader.cs deleted file mode 100644 index aa071a5..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Shaders/NormalVertexShader.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.IO; -using System.Reflection; - -namespace SlatedGameToolkit.Framework.Graphics.Shaders { - public class NormalVertexShader : GLShader - { - private GLVertexShader shader; - - public NormalVertexShader() { - using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SlatedGameToolkit.Framework.Resources.default.vert")) - { - using (StreamReader reader = new StreamReader(stream)) { - shader = new GLVertexShader(reader.ReadToEnd()); - } - } - Handle = shader.Handle; - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Shaders/VertexArray.cs b/src/SlatedGameToolkit.Framework/Graphics/Shaders/VertexArray.cs deleted file mode 100644 index d2e020e..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Shaders/VertexArray.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; - -namespace SlatedGameToolkit.Framework.Graphics.Shaders -{ - public class VertexArray : IDisposable - { - private GLVertexArraySet glVertexArraySet; - private uint index; - - public VertexArray(GLVertexArraySet gLVertexArraySet, uint index) { - this.glVertexArraySet = gLVertexArraySet; - this.index = index; - } - - public VertexArray() { - this.glVertexArraySet = new GLVertexArraySet(1); - this.index = 0; - } - - public void BufferVertices(float[] data, bool dynamic = true) { - glVertexArraySet.BufferVertices(index, data, dynamic); - } - - public void BufferIndices(uint[] data, bool dynamic = true) { - glVertexArraySet.BufferIndices(index, data, dynamic); - } - - /// - /// Defines the vertex attributes in an OpenGL vertex array object. - /// Sends as floats. - /// - /// Whether or not to automatically enable the attributes that are being defined. Defaults to true. - /// The definitions for the vertex array object. - public void defineVertexAttributes(bool enableAttributes = true, params VertexAttributeDefinition[] definitions) { - this.glVertexArraySet.defineVertexAttributes(index, enableAttributes, definitions); - } - - /// - /// Enaables the vertex array object's definitions at the given attribute indices. - /// - /// The attribute indices to be enabled. - public void EnableAttributes(params uint[] attributeIndices) { - glVertexArraySet.EnableAttributes(index, attributeIndices); - } - - /// - /// Disables the vertex array object's definitions at the given attribute indices. - /// - /// The attribute indices to be disabled. - public void DisableAttributes(params uint[] attributeIndices) { - glVertexArraySet.DisableAttributes(index, attributeIndices); - } - - public void Use() { - glVertexArraySet.Use(index); - } - - public void Dispose() - { - this.glVertexArraySet.Dispose(); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Textures/GLTexture2DSet.cs b/src/SlatedGameToolkit.Framework/Graphics/Textures/GLTexture2DSet.cs deleted file mode 100644 index 661bf67..0000000 --- a/src/SlatedGameToolkit.Framework/Graphics/Textures/GLTexture2DSet.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics; -using SlatedGameToolkit.Framework.Graphics.Textures; - -namespace SlatedGameToolkit.Framework.Graphics -{ - public sealed class GLTexture2DSet : IDisposable - { - private bool disposed; - public int Count { get; private set; } - private GLGenTextures genTextures; - private GLTexParameteri texParameteri; - private GLTexParameterfv texParameterfv; - private GLDeleteTextures deleteTextures; - private GLTexImage2D texImage2D; - private GLBindTexture bindTexture; - private GLGenerateMipmap generateMipmap; - private readonly UIntPtr[] handle; - public GLTexture2DSet(TextureData[] textureDatas, bool linear = false, bool mipmap = false) - { - genTextures = OpenGL.RetrieveGLDelegate("glGenTextures"); - deleteTextures = OpenGL.RetrieveGLDelegate("glDeleteTextures"); - bindTexture = OpenGL.RetrieveGLDelegate("glBindTexture"); - texParameteri = OpenGL.RetrieveGLDelegate("glTexParameteri"); - texParameterfv = OpenGL.RetrieveGLDelegate("glTexParameterfv"); - texImage2D = OpenGL.RetrieveGLDelegate("glTexImage2D"); - generateMipmap = OpenGL.RetrieveGLDelegate("glGenerateMipmap"); - handle = new UIntPtr[textureDatas.Length]; - genTextures((uint)textureDatas.Length, handle); - for (uint i = 0; i < textureDatas.Length; i++) { - Setup(i, textureDatas[i]); - } - bindTexture(GLEnum.GL_TEXTURE_2D, UIntPtr.Zero); - OpenGLErrorException.CheckGLErrorStatus(); - - this.Count = textureDatas.Length; - } - - private void Setup(uint index, TextureData textureData) { - Bind(index); - texImage2D(GLEnum.GL_TEXTURE_2D, 0, (int)GLEnum.GL_RGBA, textureData.width, textureData.height, 0, GLEnum.GL_RGBA, GLEnum.GL_UNSIGNED_BYTE, textureData.data); - OpenGLErrorException.CheckGLErrorStatus(); - generateMipmap(GLEnum.GL_TEXTURE_2D); - OpenGLErrorException.CheckGLErrorStatus(); - } - - /// - /// Binds the given index's texture. - /// Sets the properties given the index of the OpenGL 2D texture. - /// - /// The index of the texture. - /// Whether or not to have linear filtering. - /// Whether or not to use MipMap - public void SetProperties(uint index, GLEnum min, GLEnum mag) { - Bind(index); - texParameteri(GLEnum.GL_TEXTURE_2D, GLEnum.GL_TEXTURE_WRAP_S, (int)GLEnum.GL_CLAMP_TO_EDGE); - texParameteri(GLEnum.GL_TEXTURE_2D, GLEnum.GL_TEXTURE_WRAP_T, (int)GLEnum.GL_CLAMP_TO_EDGE); - texParameteri(GLEnum.GL_TEXTURE_2D, GLEnum.GL_TEXTURE_MIN_FILTER, (int) min); - texParameteri(GLEnum.GL_TEXTURE_2D, GLEnum.GL_TEXTURE_MAG_FILTER, (int) mag); - } - - /// - /// Binds a GL texture to the active unit. - /// - /// The index of the texture in this set. - public void Bind(uint index) { - bindTexture(GLEnum.GL_TEXTURE_2D, handle[index]); - OpenGLErrorException.CheckGLErrorStatus(); - } - - public void Dispose() - { - if (disposed) return; - this.disposed = true; - deleteTextures((uint)handle.Length, handle); - OpenGLErrorException.CheckGLErrorStatus(); - GC.SuppressFinalize(this); - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Textures/Texture.cs b/src/SlatedGameToolkit.Framework/Graphics/Textures/Texture.cs index 5979a84..e3f5f1d 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Textures/Texture.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Textures/Texture.cs @@ -1,32 +1,54 @@ -using SlatedGameToolkit.Framework.Exceptions; +using System; +using SlatedGameToolkit.Framework.Graphics.OpenGL; +using SlatedGameToolkit.Framework.Graphics.Window; using SlatedGameToolkit.Framework.Loader; namespace SlatedGameToolkit.Framework.Graphics.Textures { - public class Texture : IAssetUseable - { - private readonly GLTexture2DSet glTexture2DSet; - private readonly uint index; + public class Texture : IAssetUseable { + public readonly int width, height; + private bool disposed; + private GLContext glContext; + private uint handle; - public Texture(GLTexture2DSet set, uint index) { - this.glTexture2DSet = set; - this.index = index; - } - - public Texture(TextureData textureData, bool linear = true, bool mipmap = true) { - TextureData[] textureDatas = new TextureData[] {textureData}; - this.glTexture2DSet = new GLTexture2DSet(textureDatas, linear, mipmap); - OpenGLErrorException.CheckGLErrorStatus(); - this.index = 0; + /// + /// Creates an OpenGL Texture2D in the given GL Context. + /// + /// The texture data to use to create the Texture2D. + /// The openGL context to associate this with. If null, will use the currently active context. Defaults to null. + public unsafe Texture(TextureData textureData, GLContext context = null) { + this.glContext = context ?? WindowContextsManager.CurrentGL; + this.width = textureData.width; + this.height = textureData.height; + uint[] handles = new uint[1]; + glContext.GenTextures(1, handles); + this.handle = handles[0]; + Use(); + glContext.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Repeat); + glContext.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Repeat); + glContext.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear); + glContext.TexParameteri(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); + fixed(void* p = &textureData.data[0]) { + glContext.TexImage2D(TextureTarget.Texture2D, 0, InternalFormat.Rgba, (uint)textureData.width, (uint)textureData.height, 0, PixelFormat.Rgba, PixelType.UnsignedByte, new IntPtr(p)); + } + glContext.GenerateMipmap(OpenGL.TextureTarget.Texture2D); } public void Use() { - this.glTexture2DSet.Bind(index); + if (disposed) throw new ObjectDisposedException("Texture"); + glContext.BindTexture(OpenGL.TextureTarget.Texture2D, handle); } public void Dispose() { - this.glTexture2DSet.Dispose(); + if (disposed) return; + disposed = true; + glContext.DeleteTextures(1, new uint[] {handle}); + GC.SuppressFinalize(this); + } + + ~Texture() { + Dispose(); } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Textures/TextureData.cs b/src/SlatedGameToolkit.Framework/Graphics/Textures/TextureData.cs index 03a453d..d667f93 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Textures/TextureData.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Textures/TextureData.cs @@ -4,8 +4,14 @@ namespace SlatedGameToolkit.Framework.Graphics.Textures { public class TextureData { - public byte[] data; - public uint width; - public uint height; + public readonly byte[] data; + public readonly int width; + public readonly int height; + + public TextureData(int width, int height, byte[] data) { + this.data = data; + this.width = width; + this.height = height; + } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Window/WindowContext.cs b/src/SlatedGameToolkit.Framework/Graphics/Window/WindowContext.cs index 88e3ec0..cd0f853 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Window/WindowContext.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Window/WindowContext.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using SDL2; using SlatedGameToolkit.Framework.Exceptions; using SlatedGameToolkit.Framework.Graphics; +using SlatedGameToolkit.Framework.Graphics.OpenGL; namespace SlatedGameToolkit.Framework.Graphics.Window { @@ -34,6 +35,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Window /// public sealed class WindowContext : IDisposable { + public GLContext Context { get; private set; } /// /// The pointer referencing the SDL window. /// @@ -42,7 +44,6 @@ namespace SlatedGameToolkit.Framework.Graphics.Window /// /// The pointer referencing the OpenGL context. /// - private readonly IntPtr glContextHandle; public event WindowOperation focusGainedEvent, focusLostEvent; /// @@ -54,13 +55,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Window /// Event for when the window is being interacted with. /// public event WindowRegionHit windowRegionHitEvent; - - internal readonly GLClearColour clearColour; - internal readonly GLClear clear; - internal readonly GLViewport viewport; - private readonly GLGetError getError; - - + /// /// Whether or not to show this window. /// @@ -258,7 +253,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Window } /// - /// Instantiates a window handle. + /// Instantiates a window with the given OpenGL context, or a new context. /// public WindowContext(string title, int x = -1, int y = -1, int width = 640, int height = 480, bool specialRegions = false, SDL.SDL_WindowFlags options = default(SDL.SDL_WindowFlags)) { GameEngine.Logger.Information(String.Format("Starting openGL window with title \"{0}\"", title)); @@ -266,15 +261,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Window if (windowHandle == null) { throw new FrameworkSDLException(); } - glContextHandle = SDL.SDL_GL_CreateContext(windowHandle); - if (glContextHandle == null) { - throw new FrameworkSDLException(); - } - - clear = OpenGL.RetrieveGLDelegate("glClear"); - clearColour = OpenGL.RetrieveGLDelegate("glClearColor"); - viewport = OpenGL.RetrieveGLDelegate("glViewport"); - getError = OpenGL.RetrieveGLDelegate("glGetError"); + this.Context = new GLContext(windowHandle); if (specialRegions) { if (SDL.SDL_SetWindowHitTest(windowHandle, SpecialRegionHit, IntPtr.Zero) < 0) { @@ -286,7 +273,9 @@ namespace SlatedGameToolkit.Framework.Graphics.Window MakeCurrent(); Vector2 drawable = GetDrawableDimensions(); - viewport(0, 0, (int)drawable.X, (int)drawable.Y); + this.Context.Viewport(0, 0, (int)drawable.X, (int)drawable.Y); + this.Context.Enable(EnableCap.Blend); + Context.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha); } private SDL.SDL_HitTestResult SpecialRegionHit(IntPtr window, IntPtr hitPtr, IntPtr data) { @@ -312,14 +301,6 @@ namespace SlatedGameToolkit.Framework.Graphics.Window internal void OnFocusGained() { focusGainedEvent?.Invoke(); } - - /// - /// Gets the current GL error code. - /// - /// The unsigned int representing the status of OpenGL. - public uint GetGLStatus() { - return getError(); - } /// /// Gets the current drawable area of the window. @@ -337,7 +318,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Window /// public void MakeCurrent() { if (WindowContextsManager.CurrentWindowContext != this) { - SDL.SDL_GL_MakeCurrent(windowHandle, glContextHandle); + SDL.SDL_GL_MakeCurrent(windowHandle, Context.Handle); WindowContextsManager.current = this; } } @@ -365,13 +346,21 @@ namespace SlatedGameToolkit.Framework.Graphics.Window /// public void Dispose() { + Dispose(true); + GC.SuppressFinalize(this); + } + + public void Dispose(bool disposing) { + if (disposing) + { + } WindowContextsManager.DeregisterWindow(this); - SDL.SDL_GL_DeleteContext(glContextHandle); SDL.SDL_DestroyWindow(windowHandle); + Context.Dispose(); } ~WindowContext() { - Dispose(); + Dispose(false); } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Graphics/Window/WindowContextsManager.cs b/src/SlatedGameToolkit.Framework/Graphics/Window/WindowContextsManager.cs index 93e2b77..0a3095b 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Window/WindowContextsManager.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Window/WindowContextsManager.cs @@ -1,4 +1,7 @@ +using System; using System.Collections.Generic; +using System.Collections.ObjectModel; +using SlatedGameToolkit.Framework.Graphics.OpenGL; namespace SlatedGameToolkit.Framework.Graphics.Window { @@ -15,6 +18,25 @@ namespace SlatedGameToolkit.Framework.Graphics.Window } } private static Dictionary existingWindows = new Dictionary(); + + /// + /// The currently loaded windows. + /// + /// The ID of the window. + /// The window context. + /// A readonly dictionary of all the window contexts that were created. + public static ReadOnlyDictionary LoadedWindows { get; private set; } = new ReadOnlyDictionary(existingWindows); + + /// + /// The OpenGL context of the active window. + /// Equivalent to retrieving the current window context, and then using the context from that instance. + /// + /// The currently active window's OpenGL context. + public static GLContext CurrentGL { + get { + return CurrentWindowContext.Context; + } + } internal static void RegisterWindow(WindowContext windowHandle) { GameEngine.Logger.Debug("Registering window: " + windowHandle.WindowID); @@ -29,5 +51,16 @@ namespace SlatedGameToolkit.Framework.Graphics.Window public static WindowContext ContextFromWindowID(uint ID) { return existingWindows[ID]; } + + /// + /// Disposes all the created window contexts. + /// This includes their OpenGL contexts. + /// + public static void DisposeAllWindowContexts() { + foreach (WindowContext context in LoadedWindows.Values) + { + context.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Input/Devices/Keyboard.cs b/src/SlatedGameToolkit.Framework/Input/Devices/Keyboard.cs index 3c3d9b7..bf2c932 100644 --- a/src/SlatedGameToolkit.Framework/Input/Devices/Keyboard.cs +++ b/src/SlatedGameToolkit.Framework/Input/Devices/Keyboard.cs @@ -1,25 +1,26 @@ using System.Collections.Generic; +using SDL2; namespace SlatedGameToolkit.Framework.Input.Devices { - public delegate void keyboardUpdate(Key keys, bool pressed); + public delegate void keyboardUpdate(SDL.SDL_Keycode keys, bool pressed); public static class Keyboard { - private static HashSet pressedKeys = new HashSet(); + private static HashSet pressedKeys = new HashSet(); /// /// Whenever a keyboard update occurs. /// public static event keyboardUpdate keyboardUpdateEvent; - public static bool IsKeyPressed(Key key) { + public static bool IsKeyPressed(SDL.SDL_Keycode key) { return pressedKeys.Contains(key); } - internal static void OnKeyPressed(Key key) { + internal static void OnKeyPressed(SDL.SDL_Keycode key) { pressedKeys.Add(key); keyboardUpdateEvent?.Invoke(key, true); } - internal static void OnKeyReleased(Key key) { + internal static void OnKeyReleased(SDL.SDL_Keycode key) { pressedKeys.Remove(key); keyboardUpdateEvent?.Invoke(key, false); } diff --git a/src/SlatedGameToolkit.Framework/Input/Key.cs b/src/SlatedGameToolkit.Framework/Input/Key.cs deleted file mode 100644 index 0b481df..0000000 --- a/src/SlatedGameToolkit.Framework/Input/Key.cs +++ /dev/null @@ -1,262 +0,0 @@ -using SDL2; - -namespace SlatedGameToolkit.Framework.Input -{ - public enum Key - { - K_RETURN = SDL.SDL_Keycode.SDLK_RETURN, - K_ESCAPE = SDL.SDL_Keycode.SDLK_ESCAPE, // '\033' - K_BACKSPACE = SDL.SDL_Keycode.SDLK_BACKSPACE, - K_TAB = SDL.SDL_Keycode.SDLK_TAB, - K_SPACE = SDL.SDL_Keycode.SDLK_SPACE, - K_EXCLAIM = SDL.SDL_Keycode.SDLK_EXCLAIM, - K_QUOTEDBL = SDL.SDL_Keycode.SDLK_QUOTEDBL, - K_HASH = SDL.SDL_Keycode.SDLK_HASH, - K_PERCENT = SDL.SDL_Keycode.SDLK_PERCENT, - K_DOLLAR = SDL.SDL_Keycode.SDLK_DOLLAR, - K_AMPERSAND = SDL.SDL_Keycode.SDLK_AMPERSAND, - K_QUOTE = SDL.SDL_Keycode.SDLK_QUOTE, - K_LEFTPAREN = SDL.SDL_Keycode.SDLK_KP_LEFTPAREN, - K_RIGHTPAREN = SDL.SDL_Keycode.SDLK_RIGHTPAREN, - K_ASTERISK = SDL.SDL_Keycode.SDLK_ASTERISK, - K_PLUS = SDL.SDL_Keycode.SDLK_PLUS, - K_COMMA = SDL.SDL_Keycode.SDLK_COMMA, - K_MINUS = SDL.SDL_Keycode.SDLK_MINUS, - K_PERIOD = SDL.SDL_Keycode.SDLK_PERIOD, - K_SLASH = SDL.SDL_Keycode.SDLK_SLASH, - K_0 = SDL.SDL_Keycode.SDLK_0, - K_1 = SDL.SDL_Keycode.SDLK_1, - K_2 = SDL.SDL_Keycode.SDLK_2, - K_3 = SDL.SDL_Keycode.SDLK_3, - K_4 = SDL.SDL_Keycode.SDLK_4, - K_5 = SDL.SDL_Keycode.SDLK_5, - K_6 = SDL.SDL_Keycode.SDLK_6, - K_7 = SDL.SDL_Keycode.SDLK_7, - K_8 = SDL.SDL_Keycode.SDLK_8, - K_9 = SDL.SDL_Keycode.SDLK_9, - K_COLON = SDL.SDL_Keycode.SDLK_COLON, - K_SEMICOLON = SDL.SDL_Keycode.SDLK_SEMICOLON, - K_LESS = SDL.SDL_Keycode.SDLK_LESS, - K_EQUALS = SDL.SDL_Keycode.SDLK_EQUALS, - K_GREATER = SDL.SDL_Keycode.SDLK_GREATER, - K_QUESTION = SDL.SDL_Keycode.SDLK_QUESTION, - K_AT = SDL.SDL_Keycode.SDLK_AT, - /* - Skip uppercase letters - */ - K_LEFTBRACKET = SDL.SDL_Keycode.SDLK_LEFTBRACKET, - K_BACKSLASH = SDL.SDL_Keycode.SDLK_BACKSLASH, - K_RIGHTBRACKET = SDL.SDL_Keycode.SDLK_RIGHTBRACKET, - K_CARET = SDL.SDL_Keycode.SDLK_CARET, - K_UNDERSCORE = SDL.SDL_Keycode.SDLK_UNDERSCORE, - K_BACKQUOTE = SDL.SDL_Keycode.SDLK_BACKQUOTE, - K_a = SDL.SDL_Keycode.SDLK_a, - K_b = SDL.SDL_Keycode.SDLK_b, - K_c = SDL.SDL_Keycode.SDLK_c, - K_d = SDL.SDL_Keycode.SDLK_d, - K_e = SDL.SDL_Keycode.SDLK_e, - K_f = SDL.SDL_Keycode.SDLK_f, - K_g = SDL.SDL_Keycode.SDLK_g, - K_h = SDL.SDL_Keycode.SDLK_h, - K_i = SDL.SDL_Keycode.SDLK_i, - K_j = SDL.SDL_Keycode.SDLK_j, - K_k = SDL.SDL_Keycode.SDLK_k, - K_l = SDL.SDL_Keycode.SDLK_l, - K_m = SDL.SDL_Keycode.SDLK_m, - K_n = SDL.SDL_Keycode.SDLK_n, - K_o = SDL.SDL_Keycode.SDLK_o, - K_p = SDL.SDL_Keycode.SDLK_p, - K_q = SDL.SDL_Keycode.SDLK_q, - K_r = SDL.SDL_Keycode.SDLK_r, - K_s = SDL.SDL_Keycode.SDLK_s, - K_t = SDL.SDL_Keycode.SDLK_t, - K_u = SDL.SDL_Keycode.SDLK_u, - K_v = SDL.SDL_Keycode.SDLK_v, - K_w = SDL.SDL_Keycode.SDLK_w, - K_x = SDL.SDL_Keycode.SDLK_x, - K_y = SDL.SDL_Keycode.SDLK_y, - K_z = SDL.SDL_Keycode.SDLK_z, - - K_CAPSLOCK = SDL.SDL_Keycode.SDLK_CAPSLOCK, - - K_F1 = SDL.SDL_Keycode.SDLK_F1, - K_F2 = SDL.SDL_Keycode.SDLK_F2, - K_F3 = SDL.SDL_Keycode.SDLK_F3, - K_F4 = SDL.SDL_Keycode.SDLK_F4, - K_F5 = SDL.SDL_Keycode.SDLK_F5, - K_F6 = SDL.SDL_Keycode.SDLK_F6, - K_F7 = SDL.SDL_Keycode.SDLK_F7, - K_F8 = SDL.SDL_Keycode.SDLK_F8, - K_F9 = SDL.SDL_Keycode.SDLK_F9, - K_F10 = SDL.SDL_Keycode.SDLK_F10, - K_F11 = SDL.SDL_Keycode.SDLK_F11, - K_F12 = SDL.SDL_Keycode.SDLK_F12, - - K_PRINTSCREEN = SDL.SDL_Keycode.SDLK_PRINTSCREEN, - K_SCROLLLOCK = SDL.SDL_Keycode.SDLK_SCROLLLOCK, - K_PAUSE = SDL.SDL_Keycode.SDLK_PAUSE, - K_INSERT = SDL.SDL_Keycode.SDLK_INSERT, - K_HOME = SDL.SDL_Keycode.SDLK_HOME, - K_PAGEUP = SDL.SDL_Keycode.SDLK_PAGEUP, - K_DELETE = SDL.SDL_Keycode.SDLK_DELETE, - K_END = SDL.SDL_Keycode.SDLK_END, - K_PAGEDOWN = SDL.SDL_Keycode.SDLK_PAGEDOWN, - K_RIGHT = SDL.SDL_Keycode.SDLK_RIGHT, - K_LEFT = SDL.SDL_Keycode.SDLK_LEFT, - K_DOWN = SDL.SDL_Keycode.SDLK_DOWN, - K_UP = SDL.SDL_Keycode.SDLK_UP, - - K_NUMLOCKCLEAR = SDL.SDL_Keycode.SDLK_NUMLOCKCLEAR, - K_KP_DIVIDE = SDL.SDL_Keycode.SDLK_KP_DIVIDE, - K_KP_MULTIPLY = SDL.SDL_Keycode.SDLK_KP_MULTIPLY, - K_KP_MINUS = SDL.SDL_Keycode.SDLK_MINUS, - K_KP_PLUS = SDL.SDL_Keycode.SDLK_KP_PLUS, - K_KP_ENTER = SDL.SDL_Keycode.SDLK_KP_ENTER, - K_KP_1 = SDL.SDL_Keycode.SDLK_KP_1, - K_KP_2 = SDL.SDL_Keycode.SDLK_KP_2, - K_KP_3 = SDL.SDL_Keycode.SDLK_KP_3, - K_KP_4 = SDL.SDL_Keycode.SDLK_KP_4, - K_KP_5 = SDL.SDL_Keycode.SDLK_KP_5, - K_KP_6 = SDL.SDL_Keycode.SDLK_KP_6, - K_KP_7 = SDL.SDL_Keycode.SDLK_KP_7, - K_KP_8 = SDL.SDL_Keycode.SDLK_KP_8, - K_KP_9 = SDL.SDL_Keycode.SDLK_KP_9, - K_KP_0 = SDL.SDL_Keycode.SDLK_KP_0, - K_KP_PERIOD = SDL.SDL_Keycode.SDLK_KP_0, - - K_APPLICATION = SDL.SDL_Keycode.SDLK_APPLICATION, - K_POWER = SDL.SDL_Keycode.SDLK_POWER, - K_KP_EQUALS = SDL.SDL_Keycode.SDLK_EQUALS, - K_F13 = SDL.SDL_Keycode.SDLK_F13, - K_F14 = SDL.SDL_Keycode.SDLK_F14, - K_F15 = SDL.SDL_Keycode.SDLK_F15, - K_F16 = SDL.SDL_Keycode.SDLK_F16, - K_F17 = SDL.SDL_Keycode.SDLK_F17, - K_F18 = SDL.SDL_Keycode.SDLK_F18, - K_F19 = SDL.SDL_Keycode.SDLK_F19, - K_F20 = SDL.SDL_Keycode.SDLK_F20, - K_F21 = SDL.SDL_Keycode.SDLK_F21, - K_F22 = SDL.SDL_Keycode.SDLK_F22, - K_F23 = SDL.SDL_Keycode.SDLK_F23, - K_F24 = SDL.SDL_Keycode.SDLK_F24, - K_EXECUTE = SDL.SDL_Keycode.SDLK_EXECUTE, - K_HELP = SDL.SDL_Keycode.SDLK_HELP, - K_MENU = SDL.SDL_Keycode.SDLK_MENU, - K_SELECT = SDL.SDL_Keycode.SDLK_SELECT, - K_STOP = SDL.SDL_Keycode.SDLK_STOP, - K_AGAIN = SDL.SDL_Keycode.SDLK_AGAIN, - K_UNDO = SDL.SDL_Keycode.SDLK_UNDO, - K_CUT = SDL.SDL_Keycode.SDLK_CUT, - K_COPY = SDL.SDL_Keycode.SDLK_COPY, - K_PASTE = SDL.SDL_Keycode.SDLK_PASTE, - K_FIND = SDL.SDL_Keycode.SDLK_FIND, - K_MUTE = SDL.SDL_Keycode.SDLK_MUTE, - K_VOLUMEUP = SDL.SDL_Keycode.SDLK_VOLUMEUP, - K_VOLUMEDOWN = SDL.SDL_Keycode.SDLK_VOLUMEDOWN, - K_KP_COMMA = SDL.SDL_Keycode.SDLK_COMMA, - K_KP_EQUALSAS400 = SDL.SDL_Keycode.SDLK_KP_EQUALSAS400, - - K_ALTERASE = SDL.SDL_Keycode.SDLK_ALTERASE, - K_SYSREQ = SDL.SDL_Keycode.SDLK_SYSREQ, - K_CANCEL = SDL.SDL_Keycode.SDLK_CANCEL, - K_CLEAR = SDL.SDL_Keycode.SDLK_CLEAR, - K_PRIOR = SDL.SDL_Keycode.SDLK_PRIOR, - K_RETURN2 = SDL.SDL_Keycode.SDLK_RETURN2, - K_SEPARATOR = SDL.SDL_Keycode.SDLK_SEPARATOR, - K_OUT = SDL.SDL_Keycode.SDLK_OUT, - K_OPER = SDL.SDL_Keycode.SDLK_OPER, - K_CLEARAGAIN = SDL.SDL_Keycode.SDLK_CLEARAGAIN, - K_CRSEL = SDL.SDL_Keycode.SDLK_CRSEL, - K_EXSEL = SDL.SDL_Keycode.SDLK_EXSEL, - - K_KP_00 = SDL.SDL_Keycode.SDLK_KP_00, - K_KP_000 = SDL.SDL_Keycode.SDLK_KP_000, - K_THOUSANDSSEPARATOR = SDL.SDL_Keycode.SDLK_THOUSANDSSEPARATOR, - K_DECIMALSEPARATOR = SDL.SDL_Keycode.SDLK_DECIMALSEPARATOR, - K_CURRENCYUNIT = SDL.SDL_Keycode.SDLK_CURRENCYUNIT, - K_CURRENCYSUBUNIT = SDL.SDL_Keycode.SDLK_CURRENCYSUBUNIT, - K_KP_LEFTPAREN = SDL.SDL_Keycode.SDLK_LEFTPAREN, - K_KP_RIGHTPAREN = SDL.SDL_Keycode.SDLK_KP_RIGHTPAREN, - K_KP_LEFTBRACE = SDL.SDL_Keycode.SDLK_KP_LEFTBRACE, - K_KP_RIGHTBRACE = SDL.SDL_Keycode.SDLK_KP_RIGHTBRACE, - K_KP_TAB = SDL.SDL_Keycode.SDLK_KP_TAB, - K_KP_BACKSPACE = SDL.SDL_Keycode.SDLK_BACKSPACE, - K_KP_A = SDL.SDL_Keycode.SDLK_KP_A, - K_KP_B = SDL.SDL_Keycode.SDLK_KP_B, - K_KP_C = SDL.SDL_Keycode.SDLK_KP_C, - K_KP_D = SDL.SDL_Keycode.SDLK_KP_D, - K_KP_E = SDL.SDL_Keycode.SDLK_KP_E, - K_KP_F = SDL.SDL_Keycode.SDLK_KP_F, - K_KP_XOR = SDL.SDL_Keycode.SDLK_KP_XOR, - K_KP_POWER = SDL.SDL_Keycode.SDLK_KP_POWER, - K_KP_PERCENT = SDL.SDL_Keycode.SDLK_KP_PERCENT, - K_KP_LESS = SDL.SDL_Keycode.SDLK_KP_LESS, - K_KP_GREATER = SDL.SDL_Keycode.SDLK_KP_GREATER, - K_KP_AMPERSAND = SDL.SDL_Keycode.SDLK_KP_AMPERSAND, - K_KP_DBLAMPERSAND = SDL.SDL_Keycode.SDLK_KP_DBLAMPERSAND, - K_KP_VERTICALBAR = SDL.SDL_Keycode.SDLK_KP_VERTICALBAR, - K_KP_DBLVERTICALBAR = SDL.SDL_Keycode.SDLK_KP_DBLVERTICALBAR, - K_KP_COLON = SDL.SDL_Keycode.SDLK_KP_COLON, - K_KP_HASH = SDL.SDL_Keycode.SDLK_KP_HASH, - K_KP_SPACE = SDL.SDL_Keycode.SDLK_KP_SPACE, - K_KP_AT = SDL.SDL_Keycode.SDLK_KP_AT, - K_KP_EXCLAM = SDL.SDL_Keycode.SDLK_KP_EXCLAM, - K_KP_MEMSTORE = SDL.SDL_Keycode.SDLK_KP_MEMSTORE, - K_KP_MEMRECALL = SDL.SDL_Keycode.SDLK_KP_MEMRECALL, - K_KP_MEMCLEAR = SDL.SDL_Keycode.SDLK_KP_MEMCLEAR, - K_KP_MEMADD = SDL.SDL_Keycode.SDLK_KP_MEMADD, - K_KP_MEMSUBTRACT = SDL.SDL_Keycode.SDLK_KP_MEMSUBTRACT, - K_KP_MEMMULTIPLY = SDL.SDL_Keycode.SDLK_KP_MEMMULTIPLY, - K_KP_MEMDIVIDE = SDL.SDL_Keycode.SDLK_KP_MEMDIVIDE, - K_KP_PLUSMINUS = SDL.SDL_Keycode.SDLK_KP_PLUSMINUS, - K_KP_CLEAR = SDL.SDL_Keycode.SDLK_KP_CLEAR, - K_KP_CLEARENTRY = SDL.SDL_Keycode.SDLK_KP_CLEARENTRY, - K_KP_BINARY = SDL.SDL_Keycode.SDLK_KP_BINARY, - K_KP_OCTAL = SDL.SDL_Keycode.SDLK_KP_OCTAL, - K_KP_DECIMAL = SDL.SDL_Keycode.SDLK_KP_DECIMAL, - K_KP_HEXADECIMAL = SDL.SDL_Keycode.SDLK_KP_HEXADECIMAL, - - K_LCTRL = SDL.SDL_Keycode.SDLK_LCTRL, - K_LSHIFT = SDL.SDL_Keycode.SDLK_LSHIFT, - K_LALT = SDL.SDL_Keycode.SDLK_LALT, - K_LGUI = SDL.SDL_Keycode.SDLK_LGUI, - K_RCTRL = SDL.SDL_Keycode.SDLK_RCTRL, - K_RSHIFT = SDL.SDL_Keycode.SDLK_RSHIFT, - K_RALT = SDL.SDL_Keycode.SDLK_RALT, - K_RGUI = SDL.SDL_Keycode.SDLK_RGUI, - - K_MODE = SDL.SDL_Keycode.SDLK_MODE, - - K_AUDIONEXT = SDL.SDL_Keycode.SDLK_AUDIONEXT, - K_AUDIOPREV = SDL.SDL_Keycode.SDLK_AUDIOPREV, - K_AUDIOSTOP = SDL.SDL_Keycode.SDLK_AUDIOSTOP, - K_AUDIOPLAY = SDL.SDL_Keycode.SDLK_AUDIOPLAY, - K_AUDIOMUTE = SDL.SDL_Keycode.SDLK_AUDIOMUTE, - K_MEDIASELECT = SDL.SDL_Keycode.SDLK_MEDIASELECT, - K_WWW = SDL.SDL_Keycode.SDLK_WWW, - K_MAIL = SDL.SDL_Keycode.SDLK_MAIL, - K_CALCULATOR = SDL.SDL_Keycode.SDLK_CALCULATOR, - K_COMPUTER = SDL.SDL_Keycode.SDLK_COMPUTER, - K_AC_SEARCH = SDL.SDL_Keycode.SDLK_AC_SEARCH, - K_AC_HOME = SDL.SDL_Keycode.SDLK_AC_HOME, - K_AC_BACK = SDL.SDL_Keycode.SDLK_AC_BACK, - K_AC_FORWARD = SDL.SDL_Keycode.SDLK_AC_FORWARD, - K_AC_STOP = SDL.SDL_Keycode.SDLK_AC_STOP, - K_AC_REFRESH = SDL.SDL_Keycode.SDLK_AC_REFRESH, - K_AC_BOOKMARKS = SDL.SDL_Keycode.SDLK_AC_BOOKMARKS, - - K_BRIGHTNESSDOWN = SDL.SDL_Keycode.SDLK_BRIGHTNESSDOWN, - K_BRIGHTNESSUP = SDL.SDL_Keycode.SDLK_BRIGHTNESSUP, - K_DISPLAYSWITCH = SDL.SDL_Keycode.SDLK_DISPLAYSWITCH, - K_KBDILLUMTOGGLE = SDL.SDL_Keycode.SDLK_KBDILLUMTOGGLE, - K_KBDILLUMDOWN = SDL.SDL_Keycode.SDLK_KBDILLUMDOWN, - K_KBDILLUMUP = SDL.SDL_Keycode.SDLK_KBDILLUMUP, - K_EJECT = SDL.SDL_Keycode.SDLK_EJECT, - K_SLEEP = SDL.SDL_Keycode.SDLK_SLEEP, - K_APP1 = SDL.SDL_Keycode.SDLK_APP1, - K_APP2 = SDL.SDL_Keycode.SDLK_APP2, - - K_AUDIOREWIND = SDL.SDL_Keycode.SDLK_AUDIOREWIND, - K_AUDIOFASTFORWARD = SDL.SDL_Keycode.SDLK_AUDIOFASTFORWARD - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Loader/AssetManager.cs b/src/SlatedGameToolkit.Framework/Loader/AssetManager.cs index fef2a15..786b324 100644 --- a/src/SlatedGameToolkit.Framework/Loader/AssetManager.cs +++ b/src/SlatedGameToolkit.Framework/Loader/AssetManager.cs @@ -1,13 +1,31 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.IO; using System.Threading; +using SlatedGameToolkit.Framework.Exceptions; +using SlatedGameToolkit.Framework.Graphics.OpenGL; +using SlatedGameToolkit.Framework.Graphics.Window; namespace SlatedGameToolkit.Framework.Loader { - public class AssetManager : IDisposable { + /// + /// A delegate that should modify a given path. + /// + /// A path to modify. + /// The modified path. + public delegate string ModifyPath(string path); + /// + /// A delegate that performs the loading of the specific asset. + /// + /// The path of the asset. + /// The context to be used. May be null if called by user. + /// The type of the resulting asset. + /// A loaded, useable asset. + public delegate T LoadAsset(string path, GLContext glContext) where T : IAssetUseable; + public class AssetManager { private readonly object assetThreadLock = new object(); private Thread thread; - private ConcurrentQueue> loadables; + private ConcurrentQueue<(string, GLContext)> loadables; private volatile bool load; public bool Complete { get { @@ -15,36 +33,58 @@ namespace SlatedGameToolkit.Framework.Loader { } } private ConcurrentDictionary assets; - public ConcurrentDictionary PathModifiers {get; private set; } + + /// + /// A concurrent dictionary containing all the path modifier's in association with their extension. + /// This is what the manager uses to determine how to modify a filename or path dependent on it's extension. + /// + /// A dictionary of file extension associated with respective paths. + public ConcurrentDictionary PathModifiers { get; private set; } + + /// + /// A dictionary containing associations between file extensions and their loaders. + /// All file extensions will be requested in lower cases, and therefore, the extension key in this dictionary should also be all lowercase. + /// + /// The dictionary that associates the loaders to their file extensions. + public ConcurrentDictionary> Loaders { get ; private set; } public AssetManager() { - this.loadables = new ConcurrentQueue>(); + this.loadables = new ConcurrentQueue<(string, GLContext)>(); this.assets = new ConcurrentDictionary(); - this.PathModifiers = new ConcurrentDictionary(); - thread = new Thread(Process); + this.PathModifiers = new ConcurrentDictionary(); + this.Loaders = new ConcurrentDictionary>(); + + thread = new Thread(Run); this.load = true; thread.Name = "Asset-Loader"; thread.IsBackground = true; thread.Start(); + + RegisterCommonLoaders(); + } + + private void RegisterCommonLoaders() { + Loaders["png"] = CommonLoaders.LoadTexture; } /// /// Queue's the loadable for batched loading. /// The file name of the loadable is the one the loadable is saved under. /// - /// The loadable. - public void QueueLoad(ILoadable loadable) { - loadables.Enqueue(loadable); + /// path of file. + public void QueueLoad(string name, GLContext glContext = null) { + if (glContext == null) glContext = WindowContextsManager.CurrentGL; + loadables.Enqueue((name, glContext)); } - private void Process() { - lock (assetThreadLock) - { - ILoadable loadable; - while (load) { + private void Run() { + while (load) { + lock (assetThreadLock) + { + ValueTuple loadable; while (loadables.TryDequeue(out loadable)) { - Load(loadable); + Load(loadable.Item1, loadable.Item2); } - Monitor.Pulse(loadable); + if (load) Monitor.Wait(assetThreadLock); } } } @@ -52,10 +92,16 @@ namespace SlatedGameToolkit.Framework.Loader { /// /// Loads the loadable and stores it under the filename given to the loadable. /// - /// The loadable to load. - public void Load(ILoadable loadable) { - string name = loadable.FileName; - assets[name] = loadable.Load(PathModifiers[loadable.GetType()]); + /// The loadable to load. + /// The OpenGL context to associate with the loaded asset if the loaded asset requires it. May be null, in which the currently active context will be associated with it. + public void Load(string name, GLContext glContext = null) { + if (glContext == null) glContext = WindowContextsManager.CurrentGL; + string ext = Path.GetExtension(name).ToLower(); + if (PathModifiers.ContainsKey(ext)) { + name = PathModifiers[ext](name); + } + if (!Loaders.ContainsKey(ext)) throw new FrameworkUsageException(string.Format("Failed to find associated loader for file \"{0}\" with extension \"{1}\".", name, ext)); + assets[name] = Loaders[ext](name, glContext); } /// @@ -87,18 +133,5 @@ namespace SlatedGameToolkit.Framework.Loader { Unload(name); } } - - /// - /// Disposes of all the stored assets. - /// - public void Dispose() - { - load = false; - UnloadAll(); - } - - ~AssetManager() { - Dispose(); - } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Loader/CommonLoaders.cs b/src/SlatedGameToolkit.Framework/Loader/CommonLoaders.cs new file mode 100644 index 0000000..1ecdb0a --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Loader/CommonLoaders.cs @@ -0,0 +1,46 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; +using SDL2; +using SlatedGameToolkit.Framework.Exceptions; +using SlatedGameToolkit.Framework.Graphics.OpenGL; +using SlatedGameToolkit.Framework.Graphics.Textures; +using SlatedGameToolkit.Framework.Loader; + +namespace SlatedGameToolkit.Framework.Loader +{ + public static class CommonLoaders + { + /// + /// Loads a texture using SDL2's image library. + /// Therefore, technically, this function should be able to laod any format SDL2 Image can load. + /// + /// The path of the texture to load. + /// The OpenGL context the texture is to be associated with. + /// An OpenGL Texture associated with the given context. + public static Texture LoadTexture(string path, GLContext glContext) + { + IntPtr ptr = SDL_image.IMG_Load(path); + if (ptr.Equals(IntPtr.Zero)) throw new FrameworkSDLException("Could not find texture file at path: " + path); + SDL.SDL_Surface surface = Marshal.PtrToStructure(ptr); + SDL.SDL_PixelFormat pixelFormat = Marshal.PtrToStructure(surface.format); + if (pixelFormat.format != SDL.SDL_PIXELFORMAT_ABGR8888) { + GameEngine.Logger.Warning(string.Format("Texture \"{0}\" is of format {1}. Converting to ABGR8888. Consider saving files in such a data format for faster load times.", path, SDL.SDL_GetPixelFormatName(pixelFormat.format).Remove(0, 16))); + IntPtr convertedPtr = SDL.SDL_ConvertSurfaceFormat(ptr, SDL.SDL_PIXELFORMAT_ABGR8888, 0); + if (convertedPtr == null) throw new OptionalSDLException(); + SDL.SDL_FreeSurface(ptr); + ptr = convertedPtr; + surface = Marshal.PtrToStructure(ptr); + } + + byte[] data = new byte[surface.pitch * surface.h]; + Marshal.Copy(surface.pixels, data, 0, data.Length); + + TextureData textureData = new TextureData(surface.w, surface.h, data); + + Texture useable = new Texture(textureData, glContext); + SDL.SDL_FreeSurface(ptr); + return useable; + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Loader/ILoadable.cs b/src/SlatedGameToolkit.Framework/Loader/ILoadable.cs deleted file mode 100644 index 99521ef..0000000 --- a/src/SlatedGameToolkit.Framework/Loader/ILoadable.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace SlatedGameToolkit.Framework.Loader -{ - /// - /// The method should modify the path. - /// - /// The path to modify. - /// The modified path. - public delegate string PathModifier(string path); - - /// - /// A loader is to load an asset the game uses. - /// It is created whenever the asset needs to be loaded with a string representing the path to the file to actually load. - /// - public interface ILoadable where UseableT : IAssetUseable - { - /// - /// The name of the file to load. - /// This is what the asset manager stores the results under. - /// - /// A string representing the name to load. - string FileName { get; } - - /// - /// Loads the asset. - /// - /// Modifies the path. May be null. Default is null. - /// The loadable type. - /// The loadable type. - UseableT Load(PathModifier pathModifier = null); - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Loader/TextureLoader.cs b/src/SlatedGameToolkit.Framework/Loader/TextureLoader.cs deleted file mode 100644 index 4c97591..0000000 --- a/src/SlatedGameToolkit.Framework/Loader/TextureLoader.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using SDL2; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics.Textures; -using SlatedGameToolkit.Framework.Loader; - -namespace SlatedGameToolkit.Framework.Loader -{ - public class TextureLoader : ILoadable - { - public string FileName {get; private set; } - public TextureLoader(string path) { - this.FileName = path; - } - - public Texture Load(PathModifier pathModifier = null) - { - IntPtr ptr = SDL_image.IMG_Load(pathModifier == null ? FileName : pathModifier(FileName)); - if (ptr.Equals(IntPtr.Zero)) throw new FrameworkSDLException(); - SDL.SDL_Surface surface = Marshal.PtrToStructure(ptr); - TextureData textureData = new TextureData(); - textureData.data = new byte[surface.pitch * surface.h]; - Marshal.Copy(surface.pixels, textureData.data, 0, textureData.data.Length); - Texture useable = new Texture(textureData); - return useable; - } - } -} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Resources/default.frag b/src/SlatedGameToolkit.Framework/Resources/default.frag index f7ad5c1..4ac67a2 100644 --- a/src/SlatedGameToolkit.Framework/Resources/default.frag +++ b/src/SlatedGameToolkit.Framework/Resources/default.frag @@ -1,4 +1,4 @@ -#version 330 core +#version 330 out vec4 outputColor; in vec2 texCoord; diff --git a/src/SlatedGameToolkit.Framework/Resources/default.vert b/src/SlatedGameToolkit.Framework/Resources/default.vert index d98073a..a02eaf5 100644 --- a/src/SlatedGameToolkit.Framework/Resources/default.vert +++ b/src/SlatedGameToolkit.Framework/Resources/default.vert @@ -1,10 +1,12 @@ -#version 330 core +#version 330 in vec3 aPosition; in vec4 aColor; in vec2 aTexCoord; + uniform mat4 models; uniform mat4 view; uniform mat4 projection; + out vec2 texCoord; out vec4 color; @@ -13,5 +15,5 @@ void main() texCoord = aTexCoord; color = aColor; - gl_Position = projection * view * models * vec4(aPosition, 1.0f); + gl_Position = projection * view * models * vec4(aPosition, 1.0); } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Resources/filler.png b/src/SlatedGameToolkit.Framework/Resources/filler.png new file mode 100644 index 0000000..b707848 Binary files /dev/null and b/src/SlatedGameToolkit.Framework/Resources/filler.png differ diff --git a/src/SlatedGameToolkit.Framework/SDL2-bindings/SDL2.cs b/src/SlatedGameToolkit.Framework/SDL2/SDL2.cs similarity index 100% rename from src/SlatedGameToolkit.Framework/SDL2-bindings/SDL2.cs rename to src/SlatedGameToolkit.Framework/SDL2/SDL2.cs diff --git a/src/SlatedGameToolkit.Framework/SDL2-bindings/SDL2_image.cs b/src/SlatedGameToolkit.Framework/SDL2/SDL2_image.cs similarity index 100% rename from src/SlatedGameToolkit.Framework/SDL2-bindings/SDL2_image.cs rename to src/SlatedGameToolkit.Framework/SDL2/SDL2_image.cs diff --git a/src/SlatedGameToolkit.Framework/SDL2-bindings/SDL2_mixer.cs b/src/SlatedGameToolkit.Framework/SDL2/SDL2_mixer.cs similarity index 100% rename from src/SlatedGameToolkit.Framework/SDL2-bindings/SDL2_mixer.cs rename to src/SlatedGameToolkit.Framework/SDL2/SDL2_mixer.cs diff --git a/src/SlatedGameToolkit.Framework/SDL2-bindings/SDL2_ttf.cs b/src/SlatedGameToolkit.Framework/SDL2/SDL2_ttf.cs similarity index 100% rename from src/SlatedGameToolkit.Framework/SDL2-bindings/SDL2_ttf.cs rename to src/SlatedGameToolkit.Framework/SDL2/SDL2_ttf.cs diff --git a/src/SlatedGameToolkit.Framework/StateSystem/StateManager.cs b/src/SlatedGameToolkit.Framework/StateSystem/StateManager.cs index befd9b3..f5ace6e 100644 --- a/src/SlatedGameToolkit.Framework/StateSystem/StateManager.cs +++ b/src/SlatedGameToolkit.Framework/StateSystem/StateManager.cs @@ -2,10 +2,11 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Threading; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics; using SlatedGameToolkit.Framework.Graphics.Window; using SlatedGameToolkit.Framework.StateSystem.States; +using SlatedGameToolkit.Framework.Utilities; +using SlatedGameToolkit.Framework.Graphics; +using SlatedGameToolkit.Framework.Graphics.OpenGL; namespace SlatedGameToolkit.Framework.StateSystem { @@ -48,10 +49,8 @@ namespace SlatedGameToolkit.Framework.StateSystem internal void render(double delta) { WindowContext windowContext = WindowContextsManager.CurrentWindowContext; - windowContext.clearColour((float)backgroundColour.R / byte.MaxValue, (float)backgroundColour.G / byte.MaxValue, (float)backgroundColour.B / byte.MaxValue); - OpenGLErrorException.CheckGLErrorStatus(); - windowContext.clear(GLEnum.GL_COLOR_BUFFER_BIT | GLEnum.GL_DEPTH_BUFFER_BIT); - OpenGLErrorException.CheckGLErrorStatus(); + windowContext.Context.ClearColor(backgroundColour.RedAsFloat(), backgroundColour.GreenAsFloat(), backgroundColour.BlueAsFloat(), 1f); + windowContext.Context.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); currentState.Render(delta); windowContext.SwapBuffer(); } diff --git a/src/SlatedGameToolkit.Framework/Utilities/ColorUtils.cs b/src/SlatedGameToolkit.Framework/Utilities/ColorUtils.cs new file mode 100644 index 0000000..67e3421 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Utilities/ColorUtils.cs @@ -0,0 +1,20 @@ +using System.Drawing; + +namespace SlatedGameToolkit.Framework.Utilities +{ + public static class ColorUtils + { + public static float RedAsFloat(this Color color) { + return (float) color.R / byte.MaxValue; + } + public static float GreenAsFloat(this Color color) { + return (float) color.G / byte.MaxValue; + } + public static float BlueAsFloat(this Color color) { + return (float) color.B / byte.MaxValue; + } + public static float AlphaAsFloat(this Color color) { + return (float) color.A / byte.MaxValue; + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Utilities/EmbeddedResourceUtils.cs b/src/SlatedGameToolkit.Framework/Utilities/EmbeddedResourceUtils.cs new file mode 100644 index 0000000..e97879e --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Utilities/EmbeddedResourceUtils.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Reflection; + +namespace SlatedGameToolkit.Framework.Utilities +{ + public static class EmbeddedResourceUtils + { + public static string ReadEmbeddedResourceText(string name) { + string res; + using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(string.Format("SlatedGameToolkit.Framework.Resources.{0}", name))) + { + using (StreamReader reader = new StreamReader(stream)) { + res = reader.ReadToEnd(); + } + } + return res; + } + + public static byte[] ReadEmbeddedResourceData(string name) { + byte[] res; + using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(string.Format("SlatedGameToolkit.Framework.Resources.{0}", name))) + { + byte[] buffer = new byte[stream.Length]; + stream.Read(buffer, 0, buffer.Length); + res = buffer; + } + return res; + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Utilities/MatrixUtils.cs b/src/SlatedGameToolkit.Framework/Utilities/MatrixUtils.cs new file mode 100644 index 0000000..894c992 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Utilities/MatrixUtils.cs @@ -0,0 +1,13 @@ +using System.Numerics; + +namespace SlatedGameToolkit.Framework.Utilities +{ + public static class MatrixUtils + { + public static float[] ToColumnMajorArray(this Matrix4x4 mat) { + return new float[] { + mat.M11, mat.M12, mat.M13, mat.M14, mat.M21, mat.M22, mat.M23, mat.M24, mat.M31, mat.M32, mat.M33, mat.M34, mat.M41, mat.M42, mat.M43, mat.M44 + }; + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Framework/Utilities/VectorUtils.cs b/src/SlatedGameToolkit.Framework/Utilities/VectorUtils.cs new file mode 100644 index 0000000..1120678 --- /dev/null +++ b/src/SlatedGameToolkit.Framework/Utilities/VectorUtils.cs @@ -0,0 +1,17 @@ +using System; +using System.Numerics; + +namespace SlatedGameToolkit.Framework.Utilities +{ + public static class VectorUtils + { + public static Vector3 NormalizeSafe(this Vector3 value, Vector3 alternate) { + float l = value.Length(); + if (l == 0) { + return alternate; + } + value /= l; + return value; + } + } +} \ No newline at end of file diff --git a/src/SlatedGameToolkit.Tools/CommandSystem/CommandProcessor.cs b/src/SlatedGameToolkit.Tools/CommandSystem/CommandProcessor.cs index 224a676..8785405 100644 --- a/src/SlatedGameToolkit.Tools/CommandSystem/CommandProcessor.cs +++ b/src/SlatedGameToolkit.Tools/CommandSystem/CommandProcessor.cs @@ -25,11 +25,11 @@ namespace SlatedGameToolkit.Tools.CommandSystem string[] args = new string[splitMessage.Length - 1]; Array.Copy(splitMessage, 1, args, 0, splitMessage.Length - 1); if (!invocable.Execute(interactable, args)) { - interactable.Tell(string.Format("The command \"{0}\" was recognized, but arguments were incorrect. Please refer to Please type \"help {0}\" for more information.", invocation)); + interactable.Tell(string.Format("The command \"{0}\" arguments were incorrect. Please refer to Please type \"help {0}\" for more information.", invocation)); } return; } - interactable.Tell(string.Format("The input \"{0}\" was not understood. Please type \"help\" for more information.", invocation)); + interactable.Tell(string.Format("The command \"{0}\" was not understood. Please type \"help\" for more information.", invocation)); } } } \ No newline at end of file diff --git a/src/SlatedGameToolkit.Tools/Commands/HelpCommand.cs b/src/SlatedGameToolkit.Tools/Commands/HelpCommand.cs index df4b296..ab1e35f 100644 --- a/src/SlatedGameToolkit.Tools/Commands/HelpCommand.cs +++ b/src/SlatedGameToolkit.Tools/Commands/HelpCommand.cs @@ -21,7 +21,7 @@ namespace SlatedGameToolkit.Tools.Commands if (invocable == null) interactable.Tell("Unable to find command {0}. Please type \"help\" for more a list of commands."); StringBuilder builder = new StringBuilder(); builder.AppendJoin(", ", invocable.GetInvokers()); - interactable.Tell("Possible aliases: " + builder.ToString() + ": "); + interactable.Tell("Possible aliases: " + builder.ToString()); interactable.Tell("Description: " + invocable.getDescription()); interactable.Tell("Usage: " + invocable.getUsage(args.Length > 0 ? args[0] : null)); } else { diff --git a/src/SlatedGameToolkit.Tools/Resources/Playground/filler.png b/src/SlatedGameToolkit.Tools/Resources/Playground/filler.png new file mode 100644 index 0000000..3e6360c Binary files /dev/null and b/src/SlatedGameToolkit.Tools/Resources/Playground/filler.png differ diff --git a/src/SlatedGameToolkit.Tools/Resources/Playground/yhdnbgnc.png b/src/SlatedGameToolkit.Tools/Resources/Playground/yhdnbgnc.png index ca73e80..766129e 100644 Binary files a/src/SlatedGameToolkit.Tools/Resources/Playground/yhdnbgnc.png and b/src/SlatedGameToolkit.Tools/Resources/Playground/yhdnbgnc.png differ diff --git a/src/SlatedGameToolkit.Tools/Utilities/Playground/MainState.cs b/src/SlatedGameToolkit.Tools/Utilities/Playground/MainState.cs index 6b80852..48d8922 100644 --- a/src/SlatedGameToolkit.Tools/Utilities/Playground/MainState.cs +++ b/src/SlatedGameToolkit.Tools/Utilities/Playground/MainState.cs @@ -1,12 +1,13 @@ using System; using System.Drawing; using System.Numerics; -using SlatedGameToolkit.Framework.Exceptions; -using SlatedGameToolkit.Framework.Graphics.Programs; +using SDL2; using SlatedGameToolkit.Framework.Graphics.Render; -using SlatedGameToolkit.Framework.Graphics.Shaders; +using SlatedGameToolkit.Framework.Graphics.Render.Programs; using SlatedGameToolkit.Framework.Graphics.Textures; using SlatedGameToolkit.Framework.Graphics.Window; +using SlatedGameToolkit.Framework.Input; +using SlatedGameToolkit.Framework.Input.Devices; using SlatedGameToolkit.Framework.Loader; using SlatedGameToolkit.Framework.StateSystem; using SlatedGameToolkit.Framework.StateSystem.States; @@ -16,9 +17,8 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground public class MainState : IState { private WindowContext window; - private GLShaderProgram program; private Camera2D camera; - private Renderer renderer; + private MeshBatch renderer; private Texture texture; private Sprite2D sprite; @@ -36,10 +36,9 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground public void Deinitialize() { - window.Dispose(); - program.Dispose(); texture.Dispose(); renderer.Dispose(); + window.Dispose(); } public string getName() @@ -50,25 +49,35 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground public void Initialize(StateManager manager) { window = new WindowContext("SlatedGameToolkit Playground"); - camera = new Camera2D(); - camera.Width = window.WindowBoundaries.Width; - camera.Height = window.WindowBoundaries.Height; - camera.Position = new Vector2(camera.Width / 2, camera.Height / 2); - program = new GLShaderProgram(new NormalVertexShader(), new NormalFragmentShader()); - renderer = new Renderer(camera, program); - texture = new TextureLoader("Resources/Playground/yhdnbgnc.png").Load(); + camera = new Camera2D(2, 2); + renderer = new MeshBatch(camera); + texture = CommonLoaders.LoadTexture("Resources/Playground/yhdnbgnc.png", null); sprite = new Sprite2D(texture, Color.White); + sprite.X = -0.5f; + sprite.Y = -0.5f; } public void Render(double delta) { - OpenGLErrorException.CheckGLErrorStatus(); - renderer.Queue(sprite, Matrix4x4.Identity); - renderer.Render(); + renderer.Begin(Matrix4x4.Identity); + renderer.Draw(sprite); + renderer.End(); } public void Update(double delta) { + if (Keyboard.IsKeyPressed(SDL.SDL_Keycode.SDLK_DOWN)) { + camera.Position += new Vector2(0, (float)(-0.5f * delta)); + } + if (Keyboard.IsKeyPressed(SDL.SDL_Keycode.SDLK_UP)) { + camera.Position += new Vector2(0, (float)(0.5f * delta)); + } + if (Keyboard.IsKeyPressed(SDL.SDL_Keycode.SDLK_LEFT)) { + camera.Position += new Vector2((float)(-0.5f * delta), 0); + } + if (Keyboard.IsKeyPressed(SDL.SDL_Keycode.SDLK_RIGHT)) { + camera.Position += new Vector2((float)(0.5f * delta), 0); + } } } } \ No newline at end of file