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